瀏覽代碼

broadcast error fixes for ipv6 and /31/32

Jamie Murphy 2 年之前
父節點
當前提交
22a0ce3f76
共有 1 個文件被更改,包括 1 次插入1 次删除
  1. 1 1
      netbox/ipam/forms/model_forms.py

+ 1 - 1
netbox/ipam/forms/model_forms.py

@@ -370,7 +370,7 @@ class IPAddressForm(TenancyForm, NetBoxModelForm):
                     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)