]> Cypherpunks repositories - gostls13.git/commitdiff
net/netip: clarify Addr.Is4In6 documentation
authorDamien Neil <dneil@google.com>
Thu, 3 Oct 2024 17:00:20 +0000 (10:00 -0700)
committerDamien Neil <dneil@google.com>
Thu, 3 Oct 2024 17:53:17 +0000 (17:53 +0000)
For #65635

Change-Id: I4e4b0309d9139f970d6fd6b41303dfd2e0ec6236
Reviewed-on: https://go-review.googlesource.com/c/go/+/617835
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
src/net/netip/netip.go

index 4a8ebc678501085c76b93815b358b4572342f9b8..1ff87d2e1ea8aede139c4d5ed261d7d07bbe6b61 100644 (file)
@@ -462,7 +462,9 @@ func (ip Addr) Is4() bool {
        return ip.z == z4
 }
 
-// Is4In6 reports whether ip is an IPv4-mapped IPv6 address.
+// Is4In6 reports whether ip is an "IPv4-mapped IPv6 address"
+// as defined by RFC 4291.
+// That is, it reports whether ip is in ::ffff:0:0/96.
 func (ip Addr) Is4In6() bool {
        return ip.Is6() && ip.addr.hi == 0 && ip.addr.lo>>32 == 0xffff
 }