11 Commits

Author SHA1 Message Date
Andrei Vagin 3754522ab7 test: don't check SO_REUSEPORT for non-inet sockets
AllSocketPairTest.SetAndGetBooleanSocketOptions fails on the upstream linux
kernel. The behaviour has been changed by 5b0af621c3f6 ("net: restrict
SO_REUSEPORT to inet sockets").

PiperOrigin-RevId: 722774180
2025-02-03 13:26:03 -08:00
Andrei Vagin f010ae01ac Fix a few typos 2025-01-29 21:16:51 -08:00
Nayana Bidari 7d8307e546 Deflake socket_ip_tcp_loopback_test with S/R.
BasicSendmmsg test times out with S/R, disable the test.

PiperOrigin-RevId: 632377669
2024-05-09 22:30:52 -07:00
Nicolas Lacasse fa8676b310 Enable socket_ip_{udp,tcp}_loopback_test_runsc_ptrace_hostnet tests.
Fixes:
* Pass through some more recvmmsg flags.
* Pass through some more get/setsockopt flags.
* Allow IP_MULTICAST_LOOP/TTL to have variable size, since it can be 8 or 32
  bits.
* Convert IPPROTO_IP to IPPROTO_TCP/UDP so it can be returned properly by
  getsockopt(SO_PROTO).
* Disable one test that requires CAP_SYS_ADMIN on the host. Will have to come
  back to these.
PiperOrigin-RevId: 508938466
2023-02-11 16:17:52 -08:00
Nicolas Lacasse c0a18ec43b Fix socket_ip_tcp_generic_loopback_test_runsc_ptrace_hostnet
This was mostly a matter of allowing more get/setsockopts. Also had to support
getsockopt with a null option, because apparantly Linux allows that.

PiperOrigin-RevId: 508460614
2023-02-09 13:32:17 -08:00
Peter Johnston b9b96522ef Increase SO_RCVTIMEO for RecvTimeoutWaitAll syscall test
The timeout is currently 200ms and causes occasionally flakes in Fuchsia infra
(https://fxbug.dev/112974). Increase it to 1s.

Fixes #8140

PiperOrigin-RevId: 486141423
2022-11-04 08:04:44 -07:00
Nayana Bidari 007a91a911 Silence the error log message for SO_RCVLOWAT option.
Removed the unimplemented syscall message for SO_RCVLOWAT option and added a
test for {g,s}etsockopt.

PiperOrigin-RevId: 438145815
2022-03-29 15:48:33 -07:00
Nayana Bidari e64295053a Add a test for minimum receive buffer size used in setsockopt.
In Linux, the minimum buffer size used in setsockopt for SO_SNDBUF and
SO_RCVBUF option is the value defined in SOCK_MIN_RCVBUF and SOCK_MIN_SNDBUF.
(These values depend on the struct sk_buff size).

The minimum buffer size for SO_RCVBUF in gVisor is 4KiB. Since the value in
Linux is based on sk_buff size, it is not useful to have the same limits set
in gVisor. Added a syscall test to verify the minimum receive buffer size.

PiperOrigin-RevId: 421642931
2022-01-13 13:18:26 -08:00
Ghanan Gowripalan aa26981700 Move socket_test_util to //test/util
...and rename the library to socket_util.

PiperOrigin-RevId: 386348306
2021-07-22 16:37:15 -07:00
Kevin Krakauer cd45d7b6c8 netstack: support SO_RCVBUFFORCE
TCP is fully supported. As with SO_RCVBUF, other transport protocols perform
no-ops per DefaultSocketOptionsHandler.OnSetReceiveBufferSize.

PiperOrigin-RevId: 385023239
2021-07-15 15:34:34 -07:00
Andrei Vagin c5a4e10008 unix: sendmmsg and recvmsg have to cap a number of message to UIO_MAXIOV
Reported-by: syzbot+f2489ba0b999a45d1ad1@syzkaller.appspotmail.com
PiperOrigin-RevId: 358866218
2021-02-22 11:51:30 -08:00