11 Commits

Author SHA1 Message Date
Kevin Krakauer 48e2252b3b fix panic caused by too-large buffer allocations
Reported-by: syzbot+954128c9aa37e285d23c@syzkaller.appspotmail.com
PiperOrigin-RevId: 475345594
2022-09-19 11:45:13 -07:00
Arthur Sfez 86ad7d5b58 Support receiving ttl/hoplimit control message
PiperOrigin-RevId: 429096959
2022-02-16 11:27:21 -08:00
Arthur Sfez 4a94302baf Support receiving PKTINFO on icmp endpoints
PiperOrigin-RevId: 428599075
2022-02-14 13:51:49 -08:00
Arthur Sfez 2d9f7fc7ea Add TOS control message for ICMP & RAW sockets
PiperOrigin-RevId: 426208980
2022-02-03 12:19:06 -08:00
Ghanan Gowripalan 282a4dd52b Don't allow binding to broadcast on ICMP sockets
...to match Linux behaviour.

Fixes #5711.

PiperOrigin-RevId: 397132671
2021-09-16 11:53:49 -07:00
Ghanan Gowripalan 149ca00967 [bind] Return EINVAL for under sized address
...and EAFNOSUPPORT for unexpected address family.

To comply with Linux.

Updates #6021, #6575.

PiperOrigin-RevId: 396893590
2021-09-15 12:20:51 -07: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
Sam Balana 2406295249 Add bind syscall tests for ICMP and ICMPv6
Updates #5711
Updates #6021
Updates #6022

PiperOrigin-RevId: 377582446
2021-06-04 13:53:17 -07:00
Adin Scannell e83cc06f1b Remove _NoRandomSave tests.
We do not currently run random save tests.

PiperOrigin-RevId: 368309921
2021-04-13 15:42:41 -07:00
Tamir Duberstein 449c155bc0 Correctly check permissions in ping socket test
The previous check was using SOCK_RAW, despite the fact that the test only uses
SOCK_DGRAM. Simplify the test machinery while I'm here.

PiperOrigin-RevId: 354359842
2021-01-28 11:50:29 -08:00
Bhasker Hariharan 526df4f52a Fix error code returned due to Port exhaustion.
For TCP sockets gVisor incorrectly returns EAGAIN when no ephemeral ports are
available to bind during a connect. Linux returns EADDRNOTAVAIL. This change
fixes gVisor to return the correct code and adds a test for the same.

This change also fixes a minor bug for ping sockets where connect() would fail
with EINVAL unless the socket was bound first.

Also added tests for testing UDP Port exhaustion and Ping socket port
exhaustion.

PiperOrigin-RevId: 314988525
2020-06-05 13:43:01 -07:00