while associating then the user disconnect the network this will
cause the following:
1- __connman_service_disconnect() which will call
2-      __connman_network_disconnect() which call
3               err = network->driver->disconnect(network); 
4-              connman_network_set_connected(network, FALSE);

looking at connman_network_set_connected code
        if ((network->connecting == TRUE || network->associating == TRUE) &&
                                                        connected == FALSE) {
                connman_element_set_error(&network->element,
                                        CONNMAN_ELEMENT_ERROR_CONNECT_FAILED);
                __connman_network_disconnect(network);
        }

network->associating is TRUE and this will case to go to step 2 which
case the deadlock since this will keep looping and preventing to service
any supplicant dbus message to come in and break the deadlock.

---
 plugins/wifi.c |   15 +++++++++------
 1 files changed, 9 insertions(+), 6 deletions(-)

diff --git a/plugins/wifi.c b/plugins/wifi.c
index a159a9d..6fba131 100644
--- a/plugins/wifi.c
+++ b/plugins/wifi.c
@@ -334,10 +334,17 @@ static void interface_state(GSupplicantInterface 
*interface)
        case G_SUPPLICANT_STATE_DISCONNECTED:
                connman_network_set_associating(network, FALSE);
                connman_network_set_connected(network, FALSE);
+
+               connman_network_unref(wifi->network);
+               wifi->network = NULL;
+
                break;
 
        case G_SUPPLICANT_STATE_INACTIVE:
                connman_network_set_associating(network, FALSE);
+               connman_network_unref(wifi->network);
+
+               wifi->network = NULL;
                break;
 
        case G_SUPPLICANT_STATE_UNKNOWN:
@@ -511,16 +518,10 @@ static void connect_callback(int result, 
GSupplicantInterface *interface,
 static void disconnect_callback(int result, GSupplicantInterface *interface,
                                                        void *user_data)
 {
-       struct wifi_data *wifi = user_data;
-
        if (result < 0) {
                connman_error("%s", __func__);
                return;
        }
-
-       connman_network_unref(wifi->network);
-
-       wifi->network = NULL;
 }
 
 
@@ -617,6 +618,8 @@ static int network_disconnect(struct connman_network 
*network)
        if (wifi == NULL || wifi->interface == NULL)
                return -ENODEV;
 
+       connman_network_set_associating(network, FALSE);
+
        return g_supplicant_interface_disconnect(wifi->interface,
                                                disconnect_callback, wifi);
 }
-- 
1.7.2.3

_______________________________________________
connman mailing list
[email protected]
http://lists.connman.net/listinfo/connman

Reply via email to