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.
This commit is contained in:
Dan Williams 2012-06-04 16:02:20 -05:00
parent cfae0b79ba
commit 92de1202a0
2 changed files with 8 additions and 4 deletions

View file

@ -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;
}

View file

@ -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;
}