mirror of
https://github.com/AdguardTeam/AdGuardHome.git
synced 2025-10-26 11:27:18 +00:00
aghnet: imp net.go docs
This commit is contained in:
parent
06d172cc12
commit
3369bf3e4b
@ -201,10 +201,16 @@ func ipNetFromAddr(addr net.Addr) (ip *net.IPNet, err error) {
|
||||
return nil, fmt.Errorf("bad type for interface net.Addr %T(%[1]v)", ipNet)
|
||||
}
|
||||
|
||||
// TODO(f.setrakov): Explore whether this logic can be safely removed.
|
||||
if ip4 := ipNet.IP.To4(); ip4 != nil {
|
||||
ipNet.IP = ip4
|
||||
}
|
||||
|
||||
return ipNet, nil
|
||||
}
|
||||
|
||||
func isLinkLocalV4(ip netip.Addr) (skip bool) {
|
||||
// isLinkLocalV4 checks if ip is link-local unicast IPv4 address.
|
||||
func isLinkLocalV4(ip netip.Addr) (ok bool) {
|
||||
return ip.Is4() && ip.IsLinkLocalUnicast()
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user