core: use correct device state for supplicant link timeouts
authorDan Williams <dcbw@redhat.com>
Mon, 4 Jun 2012 21:02:20 +0000 (16:02 -0500)
committerDan Williams <dcbw@redhat.com>
Wed, 6 Jun 2012 15:25:17 +0000 (10:25 -0500)
When something fails while activated, the device should move to
the FAILED state, not directly to DISCONNECTED.

src/nm-device-ethernet.c
src/nm-device-wifi.c

index df0ae94..ede31cc 100644 (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;
        }
 
index ad1cfe3..55ecfdb 100644 (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;
 }