From e44cdc79812d82dcf24e915f440497bc503bffe4 Mon Sep 17 00:00:00 2001 From: Fernando Fernandez Mancera Date: Tue, 23 Nov 2021 11:31:40 +0100 Subject: [PATCH] ovsdb: deactivate removed device if does not have a master When using OVS link aggregation ports, NetworkManager ovsdb is removing the ports when cleaning it up. If that happens, it should deactivate the device even if it does not have controller or the state is not assume/external. An interface that is port of the OVS bonding can be activated before the ovsdb clean up, if it is not deactivated then NetworkManager will finish with a wrong configuration. The 'ovsdb_device_removed()' is already checking that the device is "ovs-interface" with subtype "system". --- src/core/devices/ovs/nm-ovs-factory.c | 9 --------- 1 file changed, 9 deletions(-) diff --git a/src/core/devices/ovs/nm-ovs-factory.c b/src/core/devices/ovs/nm-ovs-factory.c index 6f5d88326b..14f8526387 100644 --- a/src/core/devices/ovs/nm-ovs-factory.c +++ b/src/core/devices/ovs/nm-ovs-factory.c @@ -165,15 +165,6 @@ ovsdb_device_removed(NMOvsdb * ovsdb, continue; if (!nm_streq0(nm_setting_ovs_interface_get_interface_type(s_ovs_int), "system")) continue; - /* Failing the system interface device is almost always the right - * thing to do when the ovsdb entry is removed. However, to avoid - * that a late device-removed signal tears down a different, - * newly-activated connection, let's also check that we have a master. - * Or in alternative, that the device is assumed/external: in such - * case it's always fine to fail the device. - */ - if (!nm_device_get_master(d) && !nm_device_sys_iface_state_is_external_or_assume(d)) - continue; device = d; }