From 5865d01117b5671de3e5f4d4da3576865e11908c Mon Sep 17 00:00:00 2001 From: Lubomir Rintel Date: Wed, 4 Jul 2018 19:19:38 +0200 Subject: [PATCH] manager: don't save deactivating connections in the state file Especially with configure-and-quit, it's easy to encounter a condition, where the device reached a failed state, policy decides to quit, but the active connection is not yet torn down from the device. Upon the next start NetworkManager would think the connection succeeded activating. (cherry picked from commit e98ebc7e3bd96e20e47f2c60a46781484ceaa19e) --- src/nm-manager.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/nm-manager.c b/src/nm-manager.c index 6891e606b8..51b9cb424c 100644 --- a/src/nm-manager.c +++ b/src/nm-manager.c @@ -6246,7 +6246,8 @@ nm_manager_write_device_state (NMManager *self, NMDevice *device) if (managed) { NMSettingsConnection *sett_conn; - sett_conn = nm_device_get_settings_connection (device); + if (nm_device_get_state (device) <= NM_DEVICE_STATE_ACTIVATED) + sett_conn = nm_device_get_settings_connection (device); if (sett_conn) uuid = nm_settings_connection_get_uuid (sett_conn); managed_type = NM_CONFIG_DEVICE_STATE_MANAGED_TYPE_MANAGED;