Commit 8317f37a authored by Sigmund Augdal's avatar Sigmund Augdal

Minor cleanup to cidr canonicalization in iptables configurator

parent bd802054
......@@ -106,10 +106,9 @@ class Generator(object):
def add_ipset_net(self, name, net):
if "." in net:
family = "inet"
net = ipaddress.IPv4Network(net).with_prefixlen
else:
family = "inet6"
net = ipaddress.IPv6Network(net).with_prefixlen
net = ipaddress.ip_network(net).with_prefixlen
setname = self.set_name(name, family)
self.group_members[setname] += 1
self.output("add {} {}".format(setname, net))
......
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 to comment