If a bridge device (t_br0) is removed and another device (e.g. t_vlan0) references it as IFLA_MASTER (ie. the device was previously added to the bridge), an RTM_DELLINK is sent by kernel to userspace for t_vlan0 device before the bridge device is removed.
The InterfaceManager handles all RTM_DELLINK as a notification of removal of a device. In this case however, the RTM_DELLINK has a special meaning that the link between t_vlan0 and t_br0 does not exist anymore, and is indicated by PF_BRIDGE (value 7) family in the RTM_DELLINK message.
Without this patch, upon delivery of such message, the t_vlan0 device is removed from the InterfaceManager's device list and marked as deleted. Later on during the deconfiguration, the actual removal (ip link delete) of the device is skipped because LNST thinks it has been already deleted.
Signed-off-by: Jan Tluka jtluka@redhat.com --- lnst/Slave/InterfaceManager.py | 4 ++++ 1 file changed, 4 insertions(+)
diff --git a/lnst/Slave/InterfaceManager.py b/lnst/Slave/InterfaceManager.py index 858c32f1..221d386f 100644 --- a/lnst/Slave/InterfaceManager.py +++ b/lnst/Slave/InterfaceManager.py @@ -38,6 +38,7 @@ from pyroute2.netlink.rtnl import RTM_GETADDR from pyroute2.netlink.rtnl import RTM_DELADDR
NL_GROUPS = RTMGRP_IPV4_IFADDR | RTMGRP_IPV6_IFADDR | RTMGRP_LINK +PF_BRIDGE = 7
class InterfaceManager(object): def __init__(self, server_handler): @@ -127,6 +128,9 @@ class InterfaceManager(object):
dev._disable() elif msg['header']['type'] == RTM_DELLINK: + if msg['family'] == PF_BRIDGE: + return + if msg['index'] in self._devices: dev = self._devices[msg['index']] dev._deleted = True
On Mon, Jun 29, 2020 at 04:09:29PM +0200, Jan Tluka wrote:
If a bridge device (t_br0) is removed and another device (e.g. t_vlan0) references it as IFLA_MASTER (ie. the device was previously added to the bridge), an RTM_DELLINK is sent by kernel to userspace for t_vlan0 device before the bridge device is removed.
The InterfaceManager handles all RTM_DELLINK as a notification of removal of a device. In this case however, the RTM_DELLINK has a special meaning that the link between t_vlan0 and t_br0 does not exist anymore, and is indicated by PF_BRIDGE (value 7) family in the RTM_DELLINK message.
Without this patch, upon delivery of such message, the t_vlan0 device is removed from the InterfaceManager's device list and marked as deleted. Later on during the deconfiguration, the actual removal (ip link delete) of the device is skipped because LNST thinks it has been already deleted.
Signed-off-by: Jan Tluka jtluka@redhat.com
lnst/Slave/InterfaceManager.py | 4 ++++ 1 file changed, 4 insertions(+)
diff --git a/lnst/Slave/InterfaceManager.py b/lnst/Slave/InterfaceManager.py index 858c32f1..221d386f 100644 --- a/lnst/Slave/InterfaceManager.py +++ b/lnst/Slave/InterfaceManager.py @@ -38,6 +38,7 @@ from pyroute2.netlink.rtnl import RTM_GETADDR from pyroute2.netlink.rtnl import RTM_DELADDR
NL_GROUPS = RTMGRP_IPV4_IFADDR | RTMGRP_IPV6_IFADDR | RTMGRP_LINK +PF_BRIDGE = 7
class InterfaceManager(object): def __init__(self, server_handler): @@ -127,6 +128,9 @@ class InterfaceManager(object):
dev._disable() elif msg['header']['type'] == RTM_DELLINK:
if msg['family'] == PF_BRIDGE:
return
if msg['index'] in self._devices: dev = self._devices[msg['index']] dev._deleted = True
-- 2.21.3 _______________________________________________ LNST-developers mailing list -- lnst-developers@lists.fedorahosted.org To unsubscribe send an email to lnst-developers-leave@lists.fedorahosted.org Fedora Code of Conduct: https://docs.fedoraproject.org/en-US/project/code-of-conduct/ List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines List Archives: https://lists.fedorahosted.org/archives/list/lnst-developers@lists.fedorahos...
Looks good to me. Pushed.
-Ondrej
lnst-developers@lists.fedorahosted.org