Refuse local-use NAT64 addresses, and IPv4-compatible ones in blocked_networks (closes #299) #300
@@ -618,8 +618,8 @@ func isBlockedIP(ip net.IP, blocked []netip.Prefix) bool {
|
|||||||
addr = addr.Unmap()
|
addr = addr.Unmap()
|
||||||
|
|
||||||
// ip read as IPv4 where it is or holds an IPv4 address, otherwise the
|
// ip read as IPv4 where it is or holds an IPv4 address, otherwise the
|
||||||
// zero netip.Addr, which no prefix contains. It differs from addr only
|
// zero netip.Addr, which no prefix contains. Matching asIPv4 as well as
|
||||||
// for an IPv4-compatible address.
|
// addr refuses more only for an IPv4-compatible address.
|
||||||
asIPv4, _ := netip.AddrFromSlice(ipv4CompatibleToIPv4(ip).To4())
|
asIPv4, _ := netip.AddrFromSlice(ipv4CompatibleToIPv4(ip).To4())
|
||||||
|
|
||||||
return slices.ContainsFunc(blocked, func(prefix netip.Prefix) bool {
|
return slices.ContainsFunc(blocked, func(prefix netip.Prefix) bool {
|
||||||
|
|||||||
Reference in new issue
Block a user