pygui: adjustment to compensate for ip4/ip6 address not being present on joined links

This commit is contained in:
Blake Harnden 2020-05-11 08:33:56 -07:00
parent f77f37ef86
commit a36674aba9

View file

@ -147,8 +147,13 @@ class InterfaceManager:
return str(ip4), str(ip6) return str(ip4), str(ip6)
def get_subnets(self, interface: "core_pb2.Interface") -> Subnets: def get_subnets(self, interface: "core_pb2.Interface") -> Subnets:
ip4_subnet = IPNetwork(f"{interface.ip4}/{interface.ip4mask}").cidr logging.info("get subnets for interface: %s", interface)
ip6_subnet = IPNetwork(f"{interface.ip6}/{interface.ip6mask}").cidr ip4_subnet = self.ip4_subnets
if interface.ip4:
ip4_subnet = IPNetwork(f"{interface.ip4}/{interface.ip4mask}").cidr
ip6_subnet = self.ip6_subnets
if interface.ip6:
ip6_subnet = IPNetwork(f"{interface.ip6}/{interface.ip6mask}").cidr
subnets = Subnets(ip4_subnet, ip6_subnet) subnets = Subnets(ip4_subnet, ip6_subnet)
return self.used_subnets.get(subnets.key(), subnets) return self.used_subnets.get(subnets.key(), subnets)