wifi: Disable network in disconnected state
authorPatrik Flykt <patrik.flykt@linux.intel.com>
Fri, 2 Dec 2011 11:55:36 +0000 (13:55 +0200)
committerSamuel Ortiz <sameo@linux.intel.com>
Mon, 12 Dec 2011 09:44:39 +0000 (10:44 +0100)
Disable WiFi network when it ends up in disconnected state
in order to prevent wpa_supplicant looping forever retrying.

Fixes BMC#23973

plugins/wifi.c

index 745c2cb..538230a 100644 (file)
@@ -912,12 +912,6 @@ static connman_bool_t handle_4way_handshake_failure(GSupplicantInterface *interf
        if (wifi->retries < MAXIMUM_RETRIES)
                return TRUE;
 
-       /* We disable the selected network, if not then
-        * wpa_supplicant will loop retrying */
-       if (g_supplicant_interface_enable_selected_network(interface,
-                                                               FALSE) != 0)
-               DBG("Could not disables selected network");
-
        connman_network_set_error(network, CONNMAN_NETWORK_ERROR_INVALID_KEY);
 
        return FALSE;
@@ -987,6 +981,12 @@ static void interface_state(GSupplicantInterface *interface)
                                                network, wifi) == TRUE)
                        break;
 
+               /* We disable the selected network, if not then
+                * wpa_supplicant will loop retrying */
+               if (g_supplicant_interface_enable_selected_network(interface,
+                                               FALSE) != 0)
+                       DBG("Could not disables selected network");
+
                connman_network_set_associating(network, FALSE);
                connman_network_set_connected(network, FALSE);
                break;