mirror of
https://github.com/netbox-community/netbox.git
synced 2025-07-23 04:22:01 -06:00
Fixed calculation of last_ip_in_prefix for IPv6
This commit is contained in:
parent
81d955ab7d
commit
533b4082d8
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user