Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and
privacy statement. We’ll occasionally send you account related emails.
Already on GitHub?
to your account
All operating system and processor architectures
// "220.127.116.11" translated to IPv6, same as net.ParseIP("18.104.22.168")
ip := net.ParseIP("0:0:0:0:0:ffff:808:808")
_, ipv4, _ := net.ParseCIDR("0.0.0.0/0")
fmt.Println(ipv4.Contains(ip)) // true
_, ipv6, _ := net.ParseCIDR("::/0")
fmt.Println(ipv6.Contains(ip)) // why it says false?
_, translated, _ := net.ParseCIDR("::ffff:0:0/96")
fmt.Println(translated.Contains(ip)) // true
The text was updated successfully, but these errors were encountered:
Change https://golang.org/cl/221798 mentions this issue: net: IPv6 network does not contain IPv4 to IPv6 translated addresses
net: IPv6 network does not contain IPv4 to IPv6 translated addresses
Sorry, something went wrong.
/cc @mikioh @bradfitz @ianlancetaylor per owners.
No branches or pull requests