-
Notifications
You must be signed in to change notification settings - Fork 18.5k
Open
Labels
NeedsInvestigationSomeone must examine and confirm this is a valid issue and not a duplicate of an existing one.Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Milestone
Description
What version of Go are you using (go version)?
1.14
Does this issue reproduce with the latest release?
Yes
What operating system and processor architecture are you using (go env)?
All operating system and processor architectures
What did you do?
https://play.golang.org/p/IN-TOcROQnr
// "8.8.8.8" translated to IPv6, same as net.ParseIP("8.8.8.8")
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)) // trueWhat did you expect to see?
true
true
true
What did you see instead?
true
false
true
Metadata
Metadata
Assignees
Labels
NeedsInvestigationSomeone must examine and confirm this is a valid issue and not a duplicate of an existing one.Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.