File tree Expand file tree Collapse file tree 1 file changed +2
-4
lines changed
Expand file tree Collapse file tree 1 file changed +2
-4
lines changed Original file line number Diff line number Diff line change 1616
1717logger = logging .getLogger ("util" )
1818
19- _APIPA_RANGE = ipaddress .ip_network ("169.254.0.0/16" )
20-
2119
2220def createSkelSoapMessage (soapAction ):
2321 doc = minidom .Document ()
@@ -261,14 +259,14 @@ def _getNetworkAddrs(protocol_version):
261259 for ip in iface .ips :
262260 if isinstance (ip .ip , str ):
263261 ip_address = ipaddress .ip_address (ip .ip )
264- if not ip_address .is_loopback and ip_address not in _APIPA_RANGE :
262+ if not ip_address .is_loopback and not ip_address . is_link_local :
265263 addrs .append (ip_address )
266264 elif protocol_version == socket .AF_INET6 :
267265 for iface in ifaces :
268266 for ip in iface .ips :
269267 if isinstance (ip .ip , tuple ):
270268 ip_address = ipaddress .ip_address (f"{ ip .ip [0 ]} %{ ip .ip [2 ]} " )
271- if not ip_address .is_loopback and ip_address not in _APIPA_RANGE :
269+ if not ip_address .is_loopback and not ip_address . is_link_local :
272270 addrs .append (ip_address )
273271 else :
274272 logger .warning (f"requested protocol version ({ protocol_version } ) is not"
You can’t perform that action at this time.
0 commit comments