network: Fix failed to reconnect to 3G network when connect failed
authorYu A Wang <arron.wang@intel.com>
Tue, 8 Nov 2011 02:32:25 +0000 (21:32 -0500)
committerSamuel Ortiz <sameo@linux.intel.com>
Thu, 10 Nov 2011 12:39:08 +0000 (13:39 +0100)
When connect failed, set the associating value to false again, else
when we connect again the return err will be EALREADY.

src/network.c

index 090b7e7..f9dfada 100644 (file)
@@ -653,11 +653,6 @@ static void set_associate_error(struct connman_network *network)
 {
        struct connman_service *service;
 
-       if (network->associating == FALSE)
-               return ;
-
-       network->associating = FALSE;
-
        service = __connman_service_lookup_from_network(network);
 
        __connman_service_ipconfig_indicate_state(service,
@@ -669,8 +664,6 @@ static void set_configure_error(struct connman_network *network)
 {
        struct connman_service *service;
 
-       network->connecting = FALSE;
-
        service = __connman_service_lookup_from_network(network);
 
        __connman_service_ipconfig_indicate_state(service,
@@ -738,6 +731,7 @@ void connman_network_set_error(struct connman_network *network,
        DBG("nework %p, error %d", network, error);
 
        network->connecting = FALSE;
+       network->associating = FALSE;
 
        switch (error) {
        case CONNMAN_NETWORK_ERROR_UNKNOWN: