mirror of
https://github.com/netbox-community/netbox.git
synced 2025-07-24 09:28:38 -06:00
Fixes #5040: Limit SLAAC status to IPv6 addresses
This commit is contained in:
parent
9147823305
commit
78d6561e39
@ -6,6 +6,7 @@
|
|||||||
|
|
||||||
* [#5035](https://github.com/netbox-community/netbox/issues/5035) - Fix exception when modifying an IP address assigned to a VM
|
* [#5035](https://github.com/netbox-community/netbox/issues/5035) - Fix exception when modifying an IP address assigned to a VM
|
||||||
* [#5038](https://github.com/netbox-community/netbox/issues/5038) - Fix validation of primary IPs assigned to virtual machines
|
* [#5038](https://github.com/netbox-community/netbox/issues/5038) - Fix validation of primary IPs assigned to virtual machines
|
||||||
|
* [#5040](https://github.com/netbox-community/netbox/issues/5040) - Limit SLAAC status to IPv6 addresses
|
||||||
* [#5042](https://github.com/netbox-community/netbox/issues/5042) - Fix display of SLAAC label for IP addresses status
|
* [#5042](https://github.com/netbox-community/netbox/issues/5042) - Fix display of SLAAC label for IP addresses status
|
||||||
|
|
||||||
---
|
---
|
||||||
|
@ -752,6 +752,12 @@ class IPAddress(ChangeLoggedModel, CustomFieldModel):
|
|||||||
f"{self.assigned_object.virtual_machine} ({self.assigned_object})"
|
f"{self.assigned_object.virtual_machine} ({self.assigned_object})"
|
||||||
})
|
})
|
||||||
|
|
||||||
|
# Validate IP status selection
|
||||||
|
if self.status == IPAddressStatusChoices.STATUS_SLAAC and self.family != 6:
|
||||||
|
raise ValidationError({
|
||||||
|
'status': "Only IPv6 addresses can be assigned SLAAC status"
|
||||||
|
})
|
||||||
|
|
||||||
def save(self, *args, **kwargs):
|
def save(self, *args, **kwargs):
|
||||||
|
|
||||||
# Force dns_name to lowercase
|
# Force dns_name to lowercase
|
||||||
|
Loading…
Reference in New Issue
Block a user