From 8d7d2c159ce0f86f309750d7d797d7375982977c Mon Sep 17 00:00:00 2001 From: OninDynamics Date: Sun, 7 Jun 2026 16:31:15 +0800 Subject: [PATCH] stop breaking when different key is returned --- src/networkmonitor.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/networkmonitor.py b/src/networkmonitor.py index 0cdffaf6f..cbf02913f 100644 --- a/src/networkmonitor.py +++ b/src/networkmonitor.py @@ -166,8 +166,10 @@ def emit_state_changed(self): # TODO: Do this with libnm def same_subnet(self, other_ip_info): if self.current_ip_info.ip4_address is not None and other_ip_info.ip4_address is not None: + + netmask = self.current_ip_info.ip4["netmask"] or self.current_ip_info.ip4["mask"] iface = ipaddress.IPv4Interface("%s/%s" % (self.current_ip_info.ip4_address, - self.current_ip_info.ip4["netmask"])) + netmask)) my_net = iface.network