Remove class C limitation when getting local subnet

This commit is contained in:
Daniel Goldberg 2018-04-12 14:57:22 +03:00
parent dcbcc34af0
commit 7eb2a5c98b
1 changed files with 1 additions and 4 deletions

View File

@ -143,10 +143,7 @@ def get_interfaces_ranges():
netmask_str = net_interface['netmask']
ip_interface = ipaddress.ip_interface(u"%s/%s" % (address_str, netmask_str))
# limit subnet scans to class C only
if ip_interface.network.num_addresses > 255:
res.append(CidrRange(cidr_range="%s/24" % (address_str, )))
else:
res.append(CidrRange(cidr_range="%s/%s" % (address_str, netmask_str)))
res.append(CidrRange(cidr_range="%s/%s" % (address_str, netmask_str)))
return res