41 Commits
Author SHA1 Message Date
Lucas ManningandgVisor bot faac8f36cd Add support for PACKET_STATISTICS.
PiperOrigin-RevId: 725271073
2025-02-10 10:46:54 -08:00
Lucas ManningandgVisor bot 9c490f813d Implement GetSockOpt PACKET_HDRLEN and add a test for tcpdump.
PiperOrigin-RevId: 724445536
2025-02-07 13:06:14 -08:00
Lucas ManningandgVisor bot 6194338723 Add support for setting PACKET_VERSION for PACKET_MMAP.
tcpdump requires TPACKET_V2 to work properly.

PiperOrigin-RevId: 723670574
2025-02-05 15:19:34 -08:00
Lucas ManningandgVisor bot 83a4caf2a7 Implement MappablePacketEndpoint for PACKET_MMAP and add tests.
PiperOrigin-RevId: 723590936
2025-02-05 11:39:27 -08:00
Lucas ManningandgVisor bot 25b1d71341 Add constants and types related to the implementation of PACKET_MMAP.
This is the first in a series of changes that implements PACKET_MMAP.

PiperOrigin-RevId: 716014872
2025-01-15 17:45:19 -08:00
Andrei Vagin 5f4abad306 Fix a few typos
It is an idea of running codespell as part of our presubmit checks.
Before enabling it for new changes, let's fix what it has found.

Signed-off-by: Andrei Vagin <avagin@gmail.com>
2023-10-25 12:13:42 -07:00
Nicolas LacasseandgVisor bot f37b20c011 hostinet: Support ping and raw sockets.
PiperOrigin-RevId: 513902015
2023-03-04 00:40:01 -08:00
Nicolas LacasseandgVisor bot 5c30349f08 Enable more hostinet socket tests.
Fixes:
* Support for SO_MULTICAST_IF socket option.
* Support IPPROTO_ICMP protocol.

The tests that require raw sockets are disabled on hostinet, since those are
not yet supported.

PiperOrigin-RevId: 509563771
2023-02-14 10:07:54 -08:00
Arthur SfezandgVisor bot 86ad7d5b58 Support receiving ttl/hoplimit control message
PiperOrigin-RevId: 429096959
2022-02-16 11:27:21 -08:00
Ghanan GowripalanandgVisor bot beaecd1e3c Support SOL_ICMPV6 -> ICMPV6_FILTER
PiperOrigin-RevId: 417696519
2021-12-21 15:04:13 -08:00
Ayush RanjanandgVisor bot ce4f4283ba Make {Un}Marshal{Bytes/Unsafe} return remaining buffer.
Change marshal.Marshallable method signatures to return the remaining buffer.
This makes it easier to implement these method manually. Without this, we would
have to manually do buffer shifting which is error prone.

tools/go_marshal/test:benchmark test does not show change in performance.
Additionally fixed some marshalling bugs in fsimpl/fuse.

Updated multiple callpoints to get rid of redundant slice indexing work and
simplified code using this new signature.

Updates #6450

PiperOrigin-RevId: 407857019
2021-11-05 10:43:49 -07:00
Ghanan GowripalanandgVisor bot 89a0011c10 Support IPV6_RECVPKTINFO on UDP sockets
PiperOrigin-RevId: 397631833
2021-09-19 13:15:28 -07:00
Rahat MahmoodandgVisor bot f54d87b9ec Remove uses of the binary package from networking code.
Co-Author: ayushranjan
PiperOrigin-RevId: 370785009
2021-04-27 16:20:01 -07:00
Nayana BidariandgVisor bot 0a52b64794 - Add more comments for the TCP_INFO struct fields.
PiperOrigin-RevId: 354595623
2021-01-29 13:15:57 -08:00
Nayana BidariandgVisor bot 99988e45ed Add support for more fields in netstack for TCP_INFO
This CL adds support for the following fields:
- RTT, RTTVar, RTO
- send congestion window (sndCwnd) and send slow start threshold (sndSsthresh)
- congestion control state(CaState)
- ReorderSeen

PiperOrigin-RevId: 354195361
2021-01-27 16:14:50 -08:00
Ghanan GowripalanandgVisor bot abe9d9f67f Support add/remove IPv6 multicast group sock opt
IPv4 was always supported but UDP never supported joining/leaving IPv6
multicast groups via socket options.

Add: IPPROTO_IPV6, IPV6_JOIN_GROUP/IPV6_ADD_MEMBERSHIP
Remove: IPPROTO_IPV6, IPV6_LEAVE_GROUP/IPV6_DROP_MEMBERSHIP

Test: integration_test.TestUDPAddRemoveMembershipSocketOption
PiperOrigin-RevId: 350396072
2021-01-06 11:41:42 -08:00
Adin ScannellandgVisor bot 4cba3904f4 Remove existing nogo exceptions.
PiperOrigin-RevId: 347047550
2020-12-11 12:06:49 -08:00
Ayush RanjanandgVisor bot af4afdc0e0 [netstack] Decouple tcpip.ControlMessages from the IP control messges.
tcpip.ControlMessages can not contain Linux specific structures which makes it
painful to convert back and forth from Linux to tcpip back to Linux when passing
around control messages in hostinet and raw sockets.

Now we convert to the Linux version of the control message as soon as we are
out of tcpip.

PiperOrigin-RevId: 347027065
2020-12-11 10:33:58 -08:00
Rahat MahmoodandgVisor bot d201feb8c5 Enable automated marshalling for the syscall package.
PiperOrigin-RevId: 331940975
2020-09-15 23:38:57 -07:00
Kevin KrakauerandgVisor bot d50f2e2c76 ip6tables: ABI structs and constants
Part of #3549.

PiperOrigin-RevId: 326329028
2020-08-12 16:20:51 -07:00
gVisor bot 7142a86a2c Internal change.
PiperOrigin-RevId: 324819246
2020-08-04 08:49:02 -07:00
Kevin Krakauer 2a7b2a61e3 iptables: support SO_ORIGINAL_DST
Envoy (#170) uses this to get the original destination of redirected
packets.
2020-07-31 10:47:26 -07:00
6f7f739967 Marshallable socket opitons.
Socket option values are now required to implement marshal.Marshallable.

Co-authored-by: Rahat Mahmood <rahat@google.com>
PiperOrigin-RevId: 322831612
2020-07-23 11:45:10 -07:00
Bhasker HariharanandgVisor bot 71bf90c55b Support for receiving outbound packets in AF_PACKET.
Updates #173

PiperOrigin-RevId: 322665518
2020-07-22 15:33:33 -07:00
gVisor bot 69bf39e8a4 Internal change.
PiperOrigin-RevId: 294952610
2020-02-13 10:59:52 -08:00