From 6d195f7a3f305bd1fe850a779fd15fec037e9a88 Mon Sep 17 00:00:00 2001 From: Beniamino Galvani Date: Tue, 19 Jan 2021 17:40:57 +0100 Subject: [PATCH] ovs: improve disconnecting devices after removal from ovsdb Sometimes during boot the device starts an activation with reason 'assumed', then the ovs interfaces gets removed from the ovsdb. At this point the device has an active-connection associated; it has the activate_stage1_device_prepare() activation source scheduled, but it is still in disconnected state. Currently the factory doesn't recognizes that the device is activating and allows the device to proceed even if the interface was removed from the ovsdb. Fix this by checking the presence of an active-connection instead. --- src/devices/ovs/nm-ovs-factory.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/devices/ovs/nm-ovs-factory.c b/src/devices/ovs/nm-ovs-factory.c index 5e83ab29fd..10b6d7f419 100644 --- a/src/devices/ovs/nm-ovs-factory.c +++ b/src/devices/ovs/nm-ovs-factory.c @@ -176,7 +176,7 @@ ovsdb_device_removed(NMOvsdb * ovsdb, device_state = nm_device_get_state(device); - if (device_type == NM_DEVICE_TYPE_OVS_INTERFACE && device_state > NM_DEVICE_STATE_DISCONNECTED + if (device_type == NM_DEVICE_TYPE_OVS_INTERFACE && nm_device_get_act_request(device) && device_state < NM_DEVICE_STATE_DEACTIVATING) { nm_device_state_changed(device, NM_DEVICE_STATE_DEACTIVATING,