CheckResolvedIP: an IPv4-mapped prefix is not one of NAT64, a test

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
v0.13
dev 1 day ago
parent a83b44d1c8
commit e9d4ceced3

@ -64,3 +64,12 @@ func TestResolvedIPWellKnownPrefix(t *testing.T) {
}
}
}
// An IPv4-mapped prefix is not one of NAT64: the texts of TypeScript and Dart
// follow this one.
func TestResolvedIPMappedPrefix(t *testing.T) {
err := locator.CheckResolvedIP(netip.MustParseAddr("8.8.8.8"), netip.MustParsePrefix("::ffff:0.0.0.0/96"))
if err == nil || err.Error() != "locator: the NAT64 prefix ::ffff:0.0.0.0/96 is not an IPv6 prefix" {
t.Fatal(err)
}
}

Loading…
Cancel
Save

Powered by TurnKey Linux.