google / google/gvisor

ICMPv6 sockets don't return EINVAL when sending to IPv4 addresses

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

**Description**

While writing a PacketImpact test for ICMPv6 sockets, I found a discrepancy with Linux.

When bound to a unicast IPv6 address and sending to an IPv4 address, sendto returns `ENETUNREACH` whereas Linux returns `EINVAL`.

When unbound and sending to an IPv4 address, sendto **does not return an error** whereas Linux returns `EINVAL`.

**Steps to reproduce**

Run test `//third_party/gvisor/test/packetimpact/tests:generic_dgram_socket_send_recv_test` with the if statement linked to this bug removed.

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.