google / google/gvisor

UDP sockets receive from IPv4 multicast when bound by IPv6 any

Open
#5,956 5 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

**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
```

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.