diff options
author | Beniamino Galvani <bgalvani@redhat.com> | 2017-07-05 11:01:56 +0200 |
---|---|---|
committer | Beniamino Galvani <bgalvani@redhat.com> | 2017-07-05 11:19:55 +0200 |
commit | 75fb2897d7b74597d6b2993208d96a6b1ce10d57 (patch) | |
tree | e050d5e4d3cdc5ca0a16a476a563343aa45177f8 | |
parent | e96ee7fe5339e5a84fc6de722a3d309f5e9318f9 (diff) | |
download | NetworkManager-75fb2897d7b74597d6b2993208d96a6b1ce10d57.tar.gz |
checkpoint: disconnect device before reactivation during rollback
Since commit 0922a177385b ("manager: avoid that auto-activations
preempt user activations") the manager doesn't allow a internal
activation to disconnect the same connection already active on the
device. Thus, during a rollback we must ensure that the device is
deactivated before.
Fixes: 0922a177385be188b9c9c8ad39c1068533f5a4b3
(cherry picked from commit 348959cfa26b8896e7c0bafa4abae0ae77c7767c)
-rw-r--r-- | src/nm-checkpoint.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/nm-checkpoint.c b/src/nm-checkpoint.c index 3f2f0eaaa4..d59bc5743e 100644 --- a/src/nm-checkpoint.c +++ b/src/nm-checkpoint.c @@ -275,6 +275,17 @@ activate: _LOGD ("rollback: reactivating connection %s", nm_settings_connection_get_uuid (connection)); subject = nm_auth_subject_new_internal (); + + /* Disconnect the device if needed. This necessary because now + * the manager prevents the reactivation of the same connection by + * an internal subject. */ + if ( nm_device_get_state (device) > NM_DEVICE_STATE_DISCONNECTED + && nm_device_get_state (device) < NM_DEVICE_STATE_DEACTIVATING) { + nm_device_state_changed (device, + NM_DEVICE_STATE_DEACTIVATING, + NM_DEVICE_STATE_REASON_NEW_ACTIVATION); + } + if (!nm_manager_activate_connection (priv->manager, connection, dev_checkpoint->applied_connection, |