google / google/gvisor

ICMP sockets do not allow multicasting or broadcasting

Open
#5,681 4 comments 0 reactions 0 assignees View on GitHub
area: networking revived type: bug
Dominant language
Go
Stars
19.3k
Forks
2k
Avg merge
3d 5h
Merged PRs (30d)
264

Description

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.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.