Skip to content

Commit

Permalink
Merge pull request #12874 from ITJamie/broadcast_exceptions
Browse files Browse the repository at this point in the history
assigning broadcast ip error fixes for ipv6 and /31/32
  • Loading branch information
jeremystretch authored Jun 13, 2023
2 parents 43235f1 + 22a0ce3 commit 74c1f7a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion netbox/ipam/forms/model_forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -370,7 +370,7 @@ def clean(self):
raise ValidationError(msg)
if address.version == 6 and address.prefixlen not in (127, 128):
raise ValidationError(msg)
if address.ip == address.broadcast:
if address.version == 4 and address.ip == address.broadcast and address.prefixlen not in (31, 32):
msg = f"{address} is a broadcast address, which may not be assigned to an interface."
raise ValidationError(msg)

Expand Down

0 comments on commit 74c1f7a

Please sign in to comment.