gvisor icon indicating copy to clipboard operation
gvisor copied to clipboard

UDP sockets receive from IPv4 multicast when bound by IPv6 any

Open puradox opened this issue 4 years ago • 5 comments

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

  1. Run test //third_party/gvisor/test/packetimpact/tests:generic_dgram_socket_send_recv_native_test
  2. 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

puradox avatar May 06 '21 22:05 puradox

Do IPv4 sockets bound to IPv4 ANY receive such packets?

tamird avatar May 07 '21 10:05 tamird

A friendly reminder that this issue had no activity for 120 days.

github-actions[bot] avatar Sep 14 '23 00:09 github-actions[bot]

This issue has been closed due to lack of activity.

github-actions[bot] avatar Dec 14 '23 00:12 github-actions[bot]

There are TODOs still referencing this issue:

  1. test/packetimpact/tests/generic_dgram_socket_send_recv_test.go:737: Remove this if statement once gVisor

Search TODO

github-actions[bot] avatar Dec 15 '23 00:12 github-actions[bot]

A friendly reminder that this issue had no activity for 120 days.

github-actions[bot] avatar Apr 14 '24 00:04 github-actions[bot]