From 0b51fd64478fd698c2b8f864dc215e16bd0a8325 Mon Sep 17 00:00:00 2001 From: Lubomir Rintel Date: Thu, 4 Apr 2019 19:53:21 +0200 Subject: [PATCH] ovs: correct the reason for tearing down unexpectedly If the ovsdb entry gets removed without the device being deactivated, it's because its parent was removed and we should use the DEPENDENCY_FAILED reason. This is important because, with that reason, policy knows not to autoconnect and bring the port that was being removed back. --- 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 766c650bf..2124b2a0b 100644 --- a/src/devices/ovs/nm-ovs-factory.c +++ b/src/devices/ovs/nm-ovs-factory.c @@ -132,7 +132,7 @@ ovsdb_device_removed (NMOvsdb *ovsdb, const char *name, NMDeviceType device_type && device_state < NM_DEVICE_STATE_DEACTIVATING) { nm_device_state_changed (device, NM_DEVICE_STATE_DEACTIVATING, - NM_DEVICE_STATE_REASON_REMOVED); + NM_DEVICE_STATE_REASON_DEPENDENCY_FAILED); } else if (device_state == NM_DEVICE_STATE_UNMANAGED) { nm_device_unrealize (device, TRUE, NULL); }