[fix] yunomdns: Ignore ipv4 link-local addresses

This commit is contained in:
Alexandre Aubin 2021-11-28 02:51:58 +01:00
parent e3f33d6c20
commit 6854f23cca

View file

@ -21,7 +21,7 @@ def get_network_local_interfaces() -> Dict[str, Dict[str, List[str]]]:
interfaces = {
adapter.name: {
"ipv4": [ip.ip for ip in adapter.ips if ip.is_IPv4 and ip_address(ip.ip).is_private],
"ipv4": [ip.ip for ip in adapter.ips if ip.is_IPv4 and ip_address(ip.ip).is_private and not ip_address(ip.ip).is_link_local],
"ipv6": [ip.ip[0] for ip in adapter.ips if ip.is_IPv6 and ip_address(ip.ip[0]).is_private and not ip_address(ip.ip[0]).is_link_local],
}
for adapter in ifaddr.get_adapters()