diff options
author | Lubomir Rintel <lkundrak@v3.sk> | 2019-04-04 19:36:50 +0200 |
---|---|---|
committer | Lubomir Rintel <lkundrak@v3.sk> | 2019-04-08 09:31:49 +0200 |
commit | 1ebaf7730a8c599551dc82a11d59e3ee3b6e194c (patch) | |
tree | 04e4cc385ce263343d02b034dcd82815dcbb102f | |
parent | fc5003f7509e9136cfc4e3d603901ec485a4850e (diff) | |
download | NetworkManager-1ebaf7730a8c599551dc82a11d59e3ee3b6e194c.tar.gz |
Revert "ovs: don't traverse interface through disconnected when the ovsdb entry is removed"
Going directly to unmanaged just to prevent auto-connection turns out to
be the wrong thing to do. Perhaps we're reactivating the device, and
unmanaging it would interfere with the new activation.
This reverts commit 045b88a5b5445569246ec45790fdbeaf437759b8.
-rw-r--r-- | src/devices/ovs/nm-ovs-factory.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/devices/ovs/nm-ovs-factory.c b/src/devices/ovs/nm-ovs-factory.c index 0c85123f81..766c650bf1 100644 --- a/src/devices/ovs/nm-ovs-factory.c +++ b/src/devices/ovs/nm-ovs-factory.c @@ -120,13 +120,20 @@ ovsdb_device_removed (NMOvsdb *ovsdb, const char *name, NMDeviceType device_type NMDeviceFactory *self) { NMDevice *device; + NMDeviceState device_state; device = nm_manager_get_device (nm_manager_get (), name, device_type); if (!device) return; + device_state = nm_device_get_state (device); if ( device_type == NM_DEVICE_TYPE_OVS_INTERFACE - || nm_device_get_state (device) == NM_DEVICE_STATE_UNMANAGED) { + && 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); + } else if (device_state == NM_DEVICE_STATE_UNMANAGED) { nm_device_unrealize (device, TRUE, NULL); } } |