-
Notifications
You must be signed in to change notification settings - Fork 18.3k
Open
Labels
BugReportIssues describing a possible bug in the Go implementation.Issues describing a possible bug in the Go implementation.NeedsFixThe path to resolution is known, but the work has not been done.The path to resolution is known, but the work has not been done.
Milestone
Description
Go version
all versions since go1.18
Output of go env
in your module/workspace:
see above
What did you do?
Create an IPv4 UDP socket listening on 0.0.0.0
. Call WriteMsgUDPAddrPort
with an IPv4-mapped IPv6 destination address.
What did you see happen?
write udp4 0.0.0.0:48509->[::ffff:192.168.0.162]:20221: address ::ffff:192.168.0.162: non-IPv4 address
What did you expect to see?
The write succeeds, just like WriteMsgUDP
.
Back when Go 1.18 was just out, I opened #52264 for sending to IPv4 addresses on IPv6 sockets.
This issue is about the other way around: sending to IPv4-mapped IPv6 addresses on IPv4 sockets. It's less common, as IPv4 UDP sockets are less used compared to dual-stack IPv6 sockets. But it's just as painful, as APIs like net.DefaultResolver.LookupNetIP
happily return IPv4-mapped IPv6 addresses.
I'm sending a CL to address it.
Metadata
Metadata
Assignees
Labels
BugReportIssues describing a possible bug in the Go implementation.Issues describing a possible bug in the Go implementation.NeedsFixThe path to resolution is known, but the work has not been done.The path to resolution is known, but the work has not been done.