Commit 66e592a4 authored by Thomas Gambier's avatar Thomas Gambier 🚴🏼

format: use correct IPv4 for tun interfaces

Until now, the broadcast address was used for the tun interface instead
of the first address of the range.
parent 0000025c
...@@ -943,8 +943,8 @@ class Tun(Tap): ...@@ -943,8 +943,8 @@ class Tun(Tap):
ip_subnets = list(ip_network.subnet(Tun.BASE_MASK + mask_shift)) ip_subnets = list(ip_network.subnet(Tun.BASE_MASK + mask_shift))
subnet = ip_subnets[sequence] subnet = ip_subnets[sequence]
# For serialization purposes, convert directly to ``str`` # For serialization purposes, convert directly to ``str``
self.ipv4_network = str(subnet) self.ipv4_network = "{}/{}".format(subnet[1], subnet.netmask)
self.ipv4_addr = str(subnet.ip) self.ipv4_addr = str(subnet[1])
self.ipv4_netmask = str(subnet.netmask) self.ipv4_netmask = str(subnet.netmask)
def createRoutes(self): def createRoutes(self):
......
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