summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBeniamino Galvani <bgalvani@redhat.com>2015-11-03 22:38:55 +0100
committerBeniamino Galvani <bgalvani@redhat.com>2015-11-03 22:52:25 +0100
commit8b5e5a3dae0156c052cda977874ad410e182fc4b (patch)
tree319178d82bd4d20f74cc47870006a9e600453d9d
parentb78e10a06437bed01be2514332f62870efa363af (diff)
device: terminate the activation chain when entering the failed state
Device activation normally fails during one of the stages and in that case the activation chain is implicitly interrupted. But in some cases the device fails for external events (as a failure of master connection) while the activation sequence is still running and so we need to ensure that any pending activation source gets cleared upon entering the failed state. https://bugzilla.redhat.com/show_bug.cgi?id=1270814 (cherry picked from commit c8e2339091c4623d4aab790ddf8feedd95a7cd24)
-rw-r--r--src/devices/nm-device.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/devices/nm-device.c b/src/devices/nm-device.c
index 472b681321..453d294eec 100644
--- a/src/devices/nm-device.c
+++ b/src/devices/nm-device.c
@@ -8652,6 +8652,14 @@ _set_state_full (NMDevice *self,
nm_dispatcher_call (DISPATCHER_ACTION_UP, nm_act_request_get_connection (req), self, NULL, NULL, NULL);
break;
case NM_DEVICE_STATE_FAILED:
+ /* Usually upon failure the activation chain is interrupted in
+ * one of the stages; but in some cases the device fails for
+ * external events (as a failure of master connection) while
+ * the activation sequence is running and so we need to ensure
+ * that the chain is terminated here.
+ */
+ _cancel_activation (self);
+
if (nm_device_uses_assumed_connection (self)) {
/* Avoid tearing down assumed connection, assume it's connected */
nm_device_queue_state (self,