parent
8480309db2
commit
b9c64b7cf1
1 changed files with 9 additions and 0 deletions
|
@ -301,5 +301,14 @@ def is_localhost(hostname: str) -> bool:
|
||||||
address = ipaddress.ip_address(link["addr"].split("%", 1)[0])
|
address = ipaddress.ip_address(link["addr"].split("%", 1)[0])
|
||||||
if address in ips:
|
if address in ips:
|
||||||
return True
|
return True
|
||||||
|
for ip in ips:
|
||||||
|
if ip.version == 6 and ip.ipv4_mapped:
|
||||||
|
ip = ip.ipv4_mapped
|
||||||
|
|
||||||
|
if (ip.is_loopback or
|
||||||
|
ip.is_link_local or
|
||||||
|
ip.is_multicast or
|
||||||
|
ip.is_private):
|
||||||
|
return True
|
||||||
|
|
||||||
return False
|
return False
|
||||||
|
|
Loading…
Reference in a new issue