Skip to content

Commit

Permalink
Allow point-to-point prefixes allocation (/32 and /128 netmasks)
Browse files Browse the repository at this point in the history
  • Loading branch information
asenci committed Feb 28, 2017
1 parent ce6796e commit 30aa830
Showing 1 changed file with 0 additions and 11 deletions.
11 changes: 0 additions & 11 deletions netbox/ipam/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -312,17 +312,6 @@ def get_duplicates(self):
def clean(self):

if self.prefix:

# Disallow host masks
if self.prefix.version == 4 and self.prefix.prefixlen == 32:
raise ValidationError({
'prefix': "Cannot create host addresses (/32) as prefixes. Create an IPv4 address instead."
})
elif self.prefix.version == 6 and self.prefix.prefixlen == 128:
raise ValidationError({
'prefix': "Cannot create host addresses (/128) as prefixes. Create an IPv6 address instead."
})

# Enforce unique IP space (if applicable)
if (self.vrf is None and settings.ENFORCE_GLOBAL_UNIQUE) or (self.vrf and self.vrf.enforce_unique):
duplicate_prefixes = self.get_duplicates()
Expand Down

0 comments on commit 30aa830

Please sign in to comment.