UDP sockets receive from IPv4 multicast when bound by IPv6 any
Description
A discrepancy with Linux was found while improving a PacketImpact test for UDP socket send and receive.
On Linux, UDP sockets do not receive traffic from the IPv4 all systems multicast address, 224.0.0.1, when bound to the IPv6 any address, ::. On gVisor, UDP sockets receive traffic from 224.0.0.1 when bound to ::.
Steps to reproduce
- Run test
//third_party/gvisor/test/packetimpact/tests:generic_dgram_socket_send_recv_native_test - Run test
//third_party/gvisor/test/packetimpact/tests:generic_dgram_socket_send_recv_netstack_test
Passes on native but fails on netstack with the following errors:
--- FAIL: TestSocket/Receive/udp/bindTo=::/sendTo=224.0.0.1/bindToDevice=true/expectPacket=false (0.16s)
--- FAIL: TestSocket/Receive/udp/bindTo=::/sendTo=224.0.0.1/bindToDevice=true/expectPacket=false/random1k (0.00s)
third_party/gvisor/test/packetimpact/tests/generic_dgram_socket_send_recv_test.go:782: Recv got unexpected result, ret=1024, payload="[...]", errno=errno 0
--- FAIL: TestSocket/Receive/udp/bindTo=::/sendTo=224.0.0.1/bindToDevice=true/expectPacket=false/empty (0.00s)
third_party/gvisor/test/packetimpact/tests/generic_dgram_socket_send_recv_test.go:782: Recv got unexpected result, ret=0, payload="", errno=errno 0
--- FAIL: TestSocket/Receive/udp/bindTo=::/sendTo=224.0.0.1/bindToDevice=true/expectPacket=false/small (0.00s)
third_party/gvisor/test/packetimpact/tests/generic_dgram_socket_send_recv_test.go:782: Recv got unexpected result, ret=11, payload="hello world", errno=errno 0
--- FAIL: TestSocket/Receive/udp/bindTo=::/sendTo=224.0.0.1/bindToDevice=false/expectPacket=false (0.11s)
--- FAIL: TestSocket/Receive/udp/bindTo=::/sendTo=224.0.0.1/bindToDevice=false/expectPacket=false/empty (0.00s)
third_party/gvisor/test/packetimpact/tests/generic_dgram_socket_send_recv_test.go:782: Recv got unexpected result, ret=0, payload="", errno=errno 0
--- FAIL: TestSocket/Receive/udp/bindTo=::/sendTo=224.0.0.1/bindToDevice=false/expectPacket=false/small (0.00s)
third_party/gvisor/test/packetimpact/tests/generic_dgram_socket_send_recv_test.go:782: Recv got unexpected result, ret=11, payload="hello world", errno=errno 0
--- FAIL: TestSocket/Receive/udp/bindTo=::/sendTo=224.0.0.1/bindToDevice=false/expectPacket=false/random1k (0.00s)
third_party/gvisor/test/packetimpact/tests/generic_dgram_socket_send_recv_test.go:782: Recv got unexpected result, ret=1024, payload="[...]", errno=errno 0
Do IPv4 sockets bound to IPv4 ANY receive such packets?
A friendly reminder that this issue had no activity for 120 days.
This issue has been closed due to lack of activity.
There are TODOs still referencing this issue:
- test/packetimpact/tests/generic_dgram_socket_send_recv_test.go:737: Remove this if statement once gVisor
Search TODO
A friendly reminder that this issue had no activity for 120 days.