Update ip.py
parent
8d5d7226f2
commit
2e748b4727
|
@ -1,4 +1,4 @@
|
|||
from ipaddress import ip_address, ip_network, summarize_address_range
|
||||
from ipaddress import ip_address, ip_network, summarize_address_range, ip_interface
|
||||
|
||||
def parse_targets(target):
|
||||
try:
|
||||
|
@ -17,10 +17,11 @@ def parse_targets(target):
|
|||
for ip in ip_range:
|
||||
yield str(ip)
|
||||
else:
|
||||
if ip_address(target).is_link_local:
|
||||
if ip_interface(target).ip.version == 6 and ip_address(target).is_link_local:
|
||||
yield str(target)
|
||||
else:
|
||||
for ip in ip_network(target, strict=False):
|
||||
yield str(ip)
|
||||
except ValueError:
|
||||
yield str(ip)
|
||||
except ValueError as e:
|
||||
print(e)
|
||||
yield str(target)
|
||||
|
|
Loading…
Reference in New Issue