Closed mrplumber closed 4 years ago
Yeah, there is an apparently wrong assumption in the code that the interface (name) is always known before the index is used. I'll fix that. Although is it strange that the kernel provides information that refers to another information not yet provided...
@christgau are you currently aware of a temp workaround?
@christgau are you currently aware of a temp workaround?
Yes. The following should solve the problem.
diff --git a/src/wsdd.py b/src/wsdd.py
index c91eaa3..71e90f1 100755
--- a/src/wsdd.py
+++ b/src/wsdd.py
@@ -1192,11 +1192,14 @@ class NetlinkAddressMonitor(NetworkAddressMonitor):
offset += ((msg_len + 1) // NLM_HDR_ALIGNTO) * NLM_HDR_ALIGNTO
continue
- iface = self.interfaces[ifa_idx]
- if h_type == self.RTM_NEWADDR:
- self.handle_new_address(addr, ifa_family, iface)
- elif h_type == self.RTM_DELADDR:
- self.handle_deleted_address(addr, ifa_family, iface)
+ if ifa_idx in self.interfaces:
+ iface = self.interfaces[ifa_idx]
+ if h_type == self.RTM_NEWADDR:
+ self.handle_new_address(addr, ifa_family, iface)
+ elif h_type == self.RTM_DELADDR:
+ self.handle_deleted_address(addr, ifa_family, iface)
+ else:
+ logger.debug('unknown interface index: {}'.format(ifa_idx))
offset += ((msg_len + 1) // NLM_HDR_ALIGNTO) * NLM_HDR_ALIGNTO
Hi, using latest git version (0.6) of wsdd, I'm getting errors (see below, please) although it still works.
After refreshing 'Network' window on Windows 10 machine: