From ff380c37bb40690e8e845ab59ea1d1132ef1c8a5 Mon Sep 17 00:00:00 2001 From: Thomas Haller Date: Mon, 5 Feb 2018 16:45:33 +0100 Subject: [PATCH] core: transit to DISCONNECTING state for NMActiveConnection Don't just directly switch to DISCONNECTED state. If we are ACTIVATING or ACTIVATED, first transition to DISCONNECTING state. (cherry picked from commit 6d623825f6c66b4d4bbe07348c2d403856ef899f) --- src/devices/nm-device.c | 6 +++--- src/nm-manager.c | 12 ++++++------ 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/devices/nm-device.c b/src/devices/nm-device.c index 6f9289ee46..cfae48c1ea 100644 --- a/src/devices/nm-device.c +++ b/src/devices/nm-device.c @@ -9879,9 +9879,9 @@ static void _clear_queued_act_request (NMDevicePrivate *priv) { if (priv->queued_act_request) { - nm_active_connection_set_state ((NMActiveConnection *) priv->queued_act_request, - NM_ACTIVE_CONNECTION_STATE_DEACTIVATED, - NM_ACTIVE_CONNECTION_STATE_REASON_DEVICE_DISCONNECTED); + nm_active_connection_set_state_fail ((NMActiveConnection *) priv->queued_act_request, + NM_ACTIVE_CONNECTION_STATE_REASON_DEVICE_DISCONNECTED, + NULL); g_clear_object (&priv->queued_act_request); } } diff --git a/src/nm-manager.c b/src/nm-manager.c index 20e4669300..8391dbf2de 100644 --- a/src/nm-manager.c +++ b/src/nm-manager.c @@ -3592,9 +3592,9 @@ active_connection_parent_active (NMActiveConnection *active, if (!parent_ac) { _LOGW (LOGD_CORE, "The parent connection device '%s' depended on disappeared.", nm_device_get_iface (device)); - nm_active_connection_set_state (active, - NM_ACTIVE_CONNECTION_STATE_DEACTIVATED, - NM_ACTIVE_CONNECTION_STATE_REASON_DEVICE_REMOVED); + nm_active_connection_set_state_fail (active, + NM_ACTIVE_CONNECTION_STATE_REASON_DEVICE_REMOVED, + "parent device disappeared"); return; } @@ -3604,9 +3604,9 @@ active_connection_parent_active (NMActiveConnection *active, if (!nm_device_create_and_realize (device, (NMConnection *) connection, parent, &error)) { _LOGW (LOGD_CORE, "Could not realize device '%s': %s", nm_device_get_iface (device), error->message); - nm_active_connection_set_state (active, - NM_ACTIVE_CONNECTION_STATE_DEACTIVATED, - NM_ACTIVE_CONNECTION_STATE_REASON_DEVICE_REALIZE_FAILED); + nm_active_connection_set_state_fail (active, + NM_ACTIVE_CONNECTION_STATE_REASON_DEVICE_REALIZE_FAILED, + "failure to realize device"); return; }