From: Ondrej Lichtner olichtne@redhat.com
When we reconnect to netlink we risk bringing the InterfaceManager into an inconsistent state by discarding broadcast messages from the old socket. Because of this we should call rescan_devices every time a new netlink socket is bound.
Calling this method manually in the NetTestSlave after namespace creation is therefore not necessary anymore.
Signed-off-by: Ondrej Lichtner olichtne@redhat.com --- lnst/Slave/InterfaceManager.py | 2 ++ lnst/Slave/NetTestSlave.py | 1 - 2 files changed, 2 insertions(+), 1 deletion(-)
diff --git a/lnst/Slave/InterfaceManager.py b/lnst/Slave/InterfaceManager.py index 62b2805..9e89f2b 100644 --- a/lnst/Slave/InterfaceManager.py +++ b/lnst/Slave/InterfaceManager.py @@ -82,6 +82,8 @@ class InterfaceManager(object): self._nl_socket = IPRSocket() self._nl_socket.bind()
+ self.rescan_devices() + def get_nl_socket(self): return self._nl_socket
diff --git a/lnst/Slave/NetTestSlave.py b/lnst/Slave/NetTestSlave.py index 1c6f47b..8695d5e 100644 --- a/lnst/Slave/NetTestSlave.py +++ b/lnst/Slave/NetTestSlave.py @@ -643,7 +643,6 @@ class SlaveMethods: self._log_ctl.set_origin_name(netns) self._log_ctl.set_connection(write_pipe)
- self._if_manager.rescan_devices() logging.debug("Created network namespace %s" % netns) return True else: