From 92de1202a05f0d06c85612d536e8038a6bb52e6f Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Mon, 4 Jun 2012 16:02:20 -0500 Subject: [PATCH] core: use correct device state for supplicant link timeouts When something fails while activated, the device should move to the FAILED state, not directly to DISCONNECTED. --- src/nm-device-ethernet.c | 5 +++-- src/nm-device-wifi.c | 7 +++++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/src/nm-device-ethernet.c b/src/nm-device-ethernet.c index df0ae94fad..ede31cc1f6 100644 --- a/src/nm-device-ethernet.c +++ b/src/nm-device-ethernet.c @@ -753,8 +753,9 @@ link_timeout_cb (gpointer user_data) req = nm_device_get_act_request (dev); if (nm_device_get_state (dev) == NM_DEVICE_STATE_ACTIVATED) { - nm_device_state_changed (dev, NM_DEVICE_STATE_DISCONNECTED, - NM_DEVICE_STATE_REASON_SUPPLICANT_DISCONNECT); + nm_device_state_changed (dev, + NM_DEVICE_STATE_FAILED, + NM_DEVICE_STATE_REASON_SUPPLICANT_TIMEOUT); return FALSE; } diff --git a/src/nm-device-wifi.c b/src/nm-device-wifi.c index ad1cfe396f..55ecfdb2cc 100644 --- a/src/nm-device-wifi.c +++ b/src/nm-device-wifi.c @@ -2071,8 +2071,11 @@ link_timeout_cb (gpointer user_data) * to reassociate within the timeout period, so the connection must * fail. */ - if (nm_device_get_state (dev) == NM_DEVICE_STATE_ACTIVATED) - nm_device_state_changed (dev, NM_DEVICE_STATE_DISCONNECTED, NM_DEVICE_STATE_REASON_SUPPLICANT_TIMEOUT); + if (nm_device_get_state (dev) == NM_DEVICE_STATE_ACTIVATED) { + nm_device_state_changed (dev, + NM_DEVICE_STATE_FAILED, + NM_DEVICE_STATE_REASON_SUPPLICANT_TIMEOUT); + } return FALSE; }