network: Call indicate error function in error case
authorDaniel Wagner <daniel.wagner@bmw-carit.de>
Tue, 15 Nov 2011 16:49:01 +0000 (17:49 +0100)
committerDaniel Wagner <daniel.wagner@bmw-carit.de>
Tue, 15 Nov 2011 16:49:01 +0000 (17:49 +0100)
Setting the error only on one ipconfig type e.g. IPv4 is not enough.
service.c:combine_state() will report to stay in associating state:

src/service.c:service_indicate_state() service 0x6b1a60 old association - new failure/association => association

After applying the patch it loosk like this:

src/service.c:service_indicate_state() service 0x6b1f70 old association - new failure/association => association
src/service.c:service_indicate_state() service 0x6b1f70 old association - new failure/failure => failure

src/network.c

index f9dfada..058495d 100644 (file)
@@ -655,9 +655,8 @@ static void set_associate_error(struct connman_network *network)
 
        service = __connman_service_lookup_from_network(network);
 
-       __connman_service_ipconfig_indicate_state(service,
-                                       CONNMAN_SERVICE_STATE_FAILURE,
-                                       CONNMAN_IPCONFIG_TYPE_IPV4);
+       __connman_service_indicate_error(service,
+                                       CONNMAN_SERVICE_ERROR_CONNECT_FAILED);
 }
 
 static void set_configure_error(struct connman_network *network)
@@ -666,9 +665,8 @@ static void set_configure_error(struct connman_network *network)
 
        service = __connman_service_lookup_from_network(network);
 
-       __connman_service_ipconfig_indicate_state(service,
-                                       CONNMAN_SERVICE_STATE_FAILURE,
-                                       CONNMAN_IPCONFIG_TYPE_IPV4);
+       __connman_service_indicate_error(service,
+                                       CONNMAN_SERVICE_ERROR_CONNECT_FAILED);
 }
 
 static void set_invalid_key_error(struct connman_network *network)