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
{{ message }}
This repository was archived by the owner on May 25, 2023. It is now read-only.
Repository navigation
This repository was archived by the owner on May 25, 2023. It is now read-only.
Is<property>() methods disagree with net.IP for 4in6 addresses #183
For IPv4 addresses mapped to IPv6 (e.g. ::ffff:127.0.0.1) netaddr.IP methods (e.g. IsLoopback()) return false, but net.IP returns true (tested with go 1.16.4).
Given the goal of compatibility with net.IP this should probably be documented or fixed within this module. My presumption is fix, but I'm programmer, not a network expert.
I think we want to keep all the IsFoo methods not unwrapping. The 4-in-6 handling being too aggressive in Go std's net package was one of the problems we wanted to fix with netaddr. (see the third bullet under Motivation at https://pkg.go.dev/inet.af/netaddr)
Activity
moreati commentedon Jun 2, 2021
Python 3.9.5 ipaddress (for the properties it has in common) agrees with netaddr
Code
moreati commentedon Jun 10, 2021
More background research
Last updated: 2021-06-10
TODO
bradfitz commentedon Jun 10, 2021
@moreati, thanks for the info!
I think we want to keep all the IsFoo methods not unwrapping. The 4-in-6 handling being too aggressive in Go std's net package was one of the problems we wanted to fix with netaddr. (see the third bullet under Motivation at https://pkg.go.dev/inet.af/netaddr)
But, yeah, we can document it.
@danderson, @mdlayher, @josharian, sound good?
mdlayher commentedon Jun 11, 2021
Agreed. +1 to documenting but I still think 4-in-6 mapping is too niche for the prominence it has in the current stdlib.
jxsl13 commentedon Jun 13, 2021
Might be useful for this issue: IsPrivate from the latest Go changelog: https://tip.golang.org/doc/go1.17
scroll down to the net package changelog.