Commit 89143d45 authored by Mikio Hara's avatar Mikio Hara

x/net/internal/nettest: make routableIP not return the ipv6 loopback address

On some platform the IPv6 loopback address is not suitable to assign a name.

LGTM=iant
R=iant
CC=golang-codereviews
https://golang.org/cl/165710043
parent fbe893dd
......@@ -76,6 +76,9 @@ func routableIP(network string, ip net.IP) net.IP {
return ip
}
case "ip6":
if ip.IsLoopback() { // addressing scope of the loopback address depends on each implementation
return nil
}
if ip := ip.To16(); ip != nil && ip.To4() == nil {
return ip
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment