From 908d508b0724c2c9a4fb6bfd675cdc4bcae7ea6d Mon Sep 17 00:00:00 2001 From: Fernando Fernandez Mancera Date: Wed, 25 May 2022 10:07:40 +0200 Subject: [PATCH] ovsdb: do not set the device as DEACTIVATING if it is DISCONNECTED During the deactivation of ovs interfaces, ovsdb receives the command to remove the interface but for OVS system ports the device won't disappear. When reconnecting, ovsdb will update first the status and it will notice that the OVS system interface was removed and it will set the status as DEACTIVATING. This is incorrect if the status is already DEACTIVATING, DISCONNECTED, UNMANAGED or UNAVAILABLE because it will block the activation of the interface. https://bugzilla.redhat.com/show_bug.cgi?id=2080236 (cherry picked from commit bc6e28e5852395f1b53cd0782bae2c6c705079a3) (cherry picked from commit 19613a8d81f9bfccb7450229157e416bd1a27e0f) (cherry picked from commit 45c0cde9eb88595b0f94e3f3c9bc070edac3b9fa) --- src/core/devices/ovs/nm-ovs-factory.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/core/devices/ovs/nm-ovs-factory.c b/src/core/devices/ovs/nm-ovs-factory.c index 6f5d88326b..652d71b4d1 100644 --- a/src/core/devices/ovs/nm-ovs-factory.c +++ b/src/core/devices/ovs/nm-ovs-factory.c @@ -187,7 +187,8 @@ ovsdb_device_removed(NMOvsdb * ovsdb, device_state = nm_device_get_state(device); if (device_type == NM_DEVICE_TYPE_OVS_INTERFACE && nm_device_get_act_request(device) - && device_state < NM_DEVICE_STATE_DEACTIVATING) { + && (device_state > NM_DEVICE_STATE_DISCONNECTED + && device_state < NM_DEVICE_STATE_DEACTIVATING)) { nm_device_state_changed(device, NM_DEVICE_STATE_DEACTIVATING, NM_DEVICE_STATE_REASON_REMOVED);