You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
https://go-review.googlesource.com/45088 changed the behavior such that ResolveUDPAddr("[::]") followed by DialUDP on the result dials IPv4 localhost, not IPv6 localhost, which then fails when IPv4 is not configured. This is because ResolveUDPAddr unconditionally prefers IPv4 addresses when they're present in the addrList returned by internetAddrList. Looking at the code, I expect ResolveTCPAddr will have the same problem.
That's just my read of the code, of course, but it seems pretty clear: return addrs.first(isIPv4).(*UDPAddr), nil
where "isIPv4" is the predicate used to pick the preferred address from the list.
https://go-review.googlesource.com/45088 changed the behavior such that ResolveUDPAddr("[::]") followed by DialUDP on the result dials IPv4 localhost, not IPv6 localhost, which then fails when IPv4 is not configured. This is because ResolveUDPAddr unconditionally prefers IPv4 addresses when they're present in the addrList returned by internetAddrList. Looking at the code, I expect ResolveTCPAddr will have the same problem.
At d8a7990:
[::]:9999 (&net.UDPAddr{IP:net.IP{0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}, Port:9999, Zone:""}) [::1]:9999 (&net.UDPAddr{IP:net.IP{0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x1}, Port:9999, Zone:""})
At 78cf0e5:
cc @bradfitz
The text was updated successfully, but these errors were encountered: