dhcp: Call ipconfig_address_remove from dhcp_invalidate
authorSamuel Ortiz <sameo@linux.intel.com>
Tue, 31 May 2011 22:16:26 +0000 (00:16 +0200)
committerSamuel Ortiz <sameo@linux.intel.com>
Tue, 31 May 2011 22:16:26 +0000 (00:16 +0200)
Clearing the ipconfig fields is not enough, the actual rntl command needs
to be sent for the IP to be cleared.

src/dhcp.c
src/network.c

index b391ddf..ab8ee5a 100644 (file)
@@ -101,6 +101,8 @@ static void dhcp_invalidate(struct connman_dhcp *dhcp, connman_bool_t callback)
                                                dhcp->nameservers[i]);
        }
 
+       __connman_ipconfig_address_remove(ipconfig);
+
        __connman_ipconfig_set_local(ipconfig, NULL);
        __connman_ipconfig_set_broadcast(ipconfig, NULL);
        __connman_ipconfig_set_gateway(ipconfig, NULL);
index 1fa62ee..95b4d4a 100644 (file)
@@ -683,15 +683,11 @@ err:
 static void dhcp_failure(struct connman_network *network)
 {
        struct connman_service *service;
-       struct connman_ipconfig *ipconfig_ipv4;
 
        service = __connman_service_lookup_from_network(network);
        if (service == NULL)
                return;
 
-       ipconfig_ipv4 = __connman_service_get_ip4config(service);
-       __connman_ipconfig_address_remove(ipconfig_ipv4);
-
        __connman_service_indicate_state(service, CONNMAN_SERVICE_STATE_IDLE,
                                                CONNMAN_IPCONFIG_TYPE_IPV4);
 }