gvisor icon indicating copy to clipboard operation
gvisor copied to clipboard

ICMP sockets do not allow multicasting or broadcasting

Open puradox opened this issue 4 years ago • 4 comments

Creation of the first packetimpact test for ICMP sockets have uncovered a discrepancy with Linux. ICMP sockets on gVisor do not allow sending to multicast or broadcast addresses, whereas this is supported on Linux.

Note: This issue is for sending to multicast/broadcast, not binding to. ICMP sockets on Linux do not support binding to multicast or broadcast addresses.

The packetimpact failures shows we are unable to send to multicast/broadcast when bound:

--- FAIL: TestSocket/Send/icmp/bindTo=200.82.82.10/sendTo=255.255.255.255/bindToDevice=false/expectData=true (0.13s)
    --- FAIL: TestSocket/Send/icmp/bindTo=200.82.82.10/sendTo=255.255.255.255/bindToDevice=false/expectData=true/random1k (0.00s)
        third_party/gvisor/test/packetimpact/tests/udp_send_recv_dgram_test.go:460: failed to sendto: network is unreachable
    --- FAIL: TestSocket/Send/icmp/bindTo=200.82.82.10/sendTo=255.255.255.255/bindToDevice=false/expectData=true/empty (0.00s)
        third_party/gvisor/test/packetimpact/tests/udp_send_recv_dgram_test.go:460: failed to sendto: network is unreachable
    --- FAIL: TestSocket/Send/icmp/bindTo=200.82.82.10/sendTo=255.255.255.255/bindToDevice=false/expectData=true/small (0.00s)
        third_party/gvisor/test/packetimpact/tests/udp_send_recv_dgram_test.go:460: failed to sendto: network is unreachable
--- FAIL: TestSocket/Send/icmp/bindTo=200.82.82.10/sendTo=224.0.0.1/bindToDevice=false/expectData=true (0.12s)
    --- FAIL: TestSocket/Send/icmp/bindTo=200.82.82.10/sendTo=224.0.0.1/bindToDevice=false/expectData=true/empty (0.00s)
        third_party/gvisor/test/packetimpact/tests/udp_send_recv_dgram_test.go:460: failed to sendto: network is unreachable
    --- FAIL: TestSocket/Send/icmp/bindTo=200.82.82.10/sendTo=224.0.0.1/bindToDevice=false/expectData=true/small (0.00s)
        third_party/gvisor/test/packetimpact/tests/udp_send_recv_dgram_test.go:460: failed to sendto: network is unreachable
    --- FAIL: TestSocket/Send/icmp/bindTo=200.82.82.10/sendTo=224.0.0.1/bindToDevice=false/expectData=true/random1k (0.00s)
        third_party/gvisor/test/packetimpact/tests/udp_send_recv_dgram_test.go:460: failed to sendto: network is unreachable

Additionally, when unbound, the destination IPv4 address is not correctly set to multicast/broadcast.

--- FAIL: TestSocket/Send/icmp/unbound/sendTo=255.255.255.255/bindToDevice=true/expectData=true/small (1.02s)
    third_party/gvisor/test/packetimpact/tests/udp_send_recv_dgram_test.go:466: got frames:
        (Ether matches Ether)
        IPv4: DstAddr: 200.82.82.10 255.255.255.255
        (ICMPv4 matches ICMPv4)

This issue tracks the implementation of sending to multicast and broadcast addresses with ICMP sockets.

puradox avatar Mar 16 '21 20:03 puradox

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:196: Remove this case once ICMP sockets allow

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]