mirror of
https://github.com/netbox-community/netbox.git
synced 2024-05-10 07:54:54 +00:00
Fixed calculation of last_ip_in_prefix for IPv6
This commit is contained in:
@ -44,7 +44,7 @@ def add_available_ipaddresses(prefix, ipaddress_list):
|
||||
first_ip_in_prefix = netaddr.IPAddress(prefix.first)
|
||||
else:
|
||||
first_ip_in_prefix = netaddr.IPAddress(prefix.first + 1)
|
||||
if prefix.version == 4 and prefix.prefixlen == 31:
|
||||
if prefix.version == 6 or (prefix.version == 4 and prefix.prefixlen == 31):
|
||||
last_ip_in_prefix = netaddr.IPAddress(prefix.last)
|
||||
else:
|
||||
last_ip_in_prefix = netaddr.IPAddress(prefix.last - 1)
|
||||
|
Reference in New Issue
Block a user