Commit a7fca356 by Bach Dániel

firewall: rename host.ipv6_with_prefixlen

parent ab7f458e
...@@ -215,7 +215,7 @@ class Rule(models.Model): ...@@ -215,7 +215,7 @@ class Rule(models.Model):
dst = None dst = None
if host: if host:
ip = (host.ipv4, host.ipv6_with_prefixlen) ip = (host.ipv4, host.ipv6_with_host_prefixlen)
if self.direction == 'in': if self.direction == 'in':
dst = ip dst = ip
else: else:
...@@ -551,13 +551,9 @@ class Host(models.Model): ...@@ -551,13 +551,9 @@ class Host(models.Model):
self.ipv6, self.vlan.network6.prefixlen) self.ipv6, self.vlan.network6.prefixlen)
@property @property
def ipv6_with_prefixlen(self): def ipv6_with_host_prefixlen(self):
try: return Host.create_ipnetwork(
net = IPNetwork(self.ipv6) self.ipv6, self.vlan.host_ipv6_prefixlen)
net.prefixlen = self.vlan.host_ipv6_prefixlen
return net
except TypeError:
return None
def get_external_ipv4(self): def get_external_ipv4(self):
return self.external_ipv4 if self.external_ipv4 else self.ipv4 return self.external_ipv4 if self.external_ipv4 else self.ipv4
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment