summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFernando Fernandez Mancera <ffmancera@riseup.net>2022-01-27 13:23:35 +0100
committerFernando Fernandez Mancera <ffmancera@riseup.net>2022-01-31 10:54:04 +0100
commitd24a6a577055af0f15cce78c30ca3cad93df7b0d (patch)
treea973b40d8cbc5145fa72857089b922379788f1b7
parent0f5536d60c393923cf03ff6edb5e9a177fff0e8b (diff)
downloadNetworkManager-ff/ovs_interface_reboot.tar.gz
ovsdb: unrealize removed ovs-interfaces on UNAVAILABLE stateff/ovs_interface_reboot
When NetworkManager shuts down, it is not done properly. We cannot ensure that all pending async operations are cancelled and therefore there are possible device leaks. This means that not all the devices will be disposed and finalized because a different component is handling a reference to it. Since the l3cfg refactor, this is affecting to ovs ports. When shutting down sometimes there are ovs-interface or ovs-port devices that are not being cleared correctly. When starting NetworkManager back, these devices are not going to be created again because they already exist and the existing compatible connections will be instruct to use the device. But currently, ovsdb is only unrealizing a device after removal if the state is UNMANAGED. This is wrong, because it will left an inconsistent state in NetworkManager and the ovs-port/ovs-interface connection won't be activated. The interfaces removed by ovsdb must be unrealized if they are on UNAVAILABLE state. https://bugzilla.redhat.com/show_bug.cgi?id=2029937
-rw-r--r--src/core/devices/ovs/nm-ovs-factory.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/core/devices/ovs/nm-ovs-factory.c b/src/core/devices/ovs/nm-ovs-factory.c
index 795435968d..3ff0abf878 100644
--- a/src/core/devices/ovs/nm-ovs-factory.c
+++ b/src/core/devices/ovs/nm-ovs-factory.c
@@ -186,9 +186,10 @@ ovsdb_device_removed(NMOvsdb *ovsdb,
}
/* OVS system interfaces still exist even without the ovsdb entry */
- if (!is_system_interface && device_state == NM_DEVICE_STATE_UNMANAGED) {
+ if (!is_system_interface
+ && (device_state == NM_DEVICE_STATE_UNMANAGED
+ || device_state == NM_DEVICE_STATE_UNAVAILABLE))
nm_device_unrealize(device, TRUE, NULL);
- }
}
static void