connection: Do not move to DISCONNECT when removing a gateway
authorSamuel Ortiz <sameo@linux.intel.com>
Fri, 25 Feb 2011 19:49:42 +0000 (20:49 +0100)
committerSamuel Ortiz <sameo@linux.intel.com>
Fri, 25 Feb 2011 19:49:42 +0000 (20:49 +0100)
The state change should be handled by the caller.

src/connection.c
src/network.c

index fb2e431905042837f0472c9e49f5ac87bf470fed..8ca1f7a0dcced6e6a8fee7fbfc043f2004a6aa18 100644 (file)
@@ -348,14 +348,6 @@ void __connman_connection_gateway_remove(struct connman_service *service)
 
        __connman_service_nameserver_del_routes(service);
 
-       __connman_service_indicate_state(service,
-                                       CONNMAN_SERVICE_STATE_DISCONNECT,
-                                       CONNMAN_IPCONFIG_TYPE_IPV4);
-
-       __connman_service_indicate_state(service,
-                                       CONNMAN_SERVICE_STATE_DISCONNECT,
-                                       CONNMAN_IPCONFIG_TYPE_IPV6);
-
        data = g_hash_table_lookup(gateway_hash, service);
        if (data == NULL)
                return;
index babb28ba4c009c7e782018cf5f41279b175cadc2..77b58897f429c7574b2eccddb4991b18155cfb90 100644 (file)
@@ -923,6 +923,14 @@ static gboolean set_connected(gpointer user_data)
 
                service = __connman_service_lookup_from_network(network);
 
+               __connman_service_indicate_state(service,
+                                       CONNMAN_SERVICE_STATE_DISCONNECT,
+                                       CONNMAN_IPCONFIG_TYPE_IPV4);
+
+               __connman_service_indicate_state(service,
+                                       CONNMAN_SERVICE_STATE_DISCONNECT,
+                                       CONNMAN_IPCONFIG_TYPE_IPV6);
+
                __connman_connection_gateway_remove(service);
 
                __connman_service_indicate_state(service,