From c8e2339091c4623d4aab790ddf8feedd95a7cd24 Mon Sep 17 00:00:00 2001 From: Beniamino Galvani Date: Tue, 3 Nov 2015 22:38:55 +0100 Subject: [PATCH] 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 --- src/devices/nm-device.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/devices/nm-device.c b/src/devices/nm-device.c index 4b6d2d45fc..bffe8268e5 100644 --- a/src/devices/nm-device.c +++ b/src/devices/nm-device.c @@ -9268,6 +9268,14 @@ _set_state_full (NMDevice *self, 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,