Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion src/networkmonitor.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down