Skip to content
New issue

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? Sign in to your account

net: IPv6 network does not contain IPv4 to IPv6 translated addresses #37597

Open
pixelbender opened this issue Mar 2, 2020 · 2 comments
Open
Labels
NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Milestone

Comments

@pixelbender
Copy link

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)) // true

What did you expect to see?

true
true
true

What did you see instead?

true
false
true
@gopherbot
Copy link

Change https://golang.org/cl/221798 mentions this issue: net: IPv6 network does not contain IPv4 to IPv6 translated addresses

@dmitshur dmitshur added the NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. label Mar 2, 2020
@dmitshur dmitshur added this to the Backlog milestone Mar 2, 2020
@dmitshur
Copy link
Contributor

dmitshur commented Mar 2, 2020

/cc @mikioh @bradfitz @ianlancetaylor per owners.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Projects
None yet
Development

No branches or pull requests

3 participants