From: Daniel Wagner Date: Mon, 25 Jul 2011 14:24:23 +0000 (+0200) Subject: network: Stop DHCP X-Git-Tag: 0.77~90 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=92c0a3bbf71ea93a49cb20a520d003c147e52871;p=platform%2Fupstream%2Fconnman.git network: Stop DHCP If DHCP has been started for the IPv4 IP configuration we should also stop it later. The only place where it has been done so far was in __connman_network_clear_ipconfig() which is called from service.c:set_ipconfig(). But this will only be called if the user changes service settings. --- diff --git a/src/network.c b/src/network.c index 58bfb16..06aec05 100644 --- a/src/network.c +++ b/src/network.c @@ -1075,6 +1075,18 @@ static gboolean set_connected(gpointer user_data) service = __connman_service_lookup_from_network(network); + switch (ipv4_method) { + case CONNMAN_IPCONFIG_METHOD_UNKNOWN: + case CONNMAN_IPCONFIG_METHOD_OFF: + case CONNMAN_IPCONFIG_METHOD_AUTO: + case CONNMAN_IPCONFIG_METHOD_FIXED: + case CONNMAN_IPCONFIG_METHOD_MANUAL: + break; + case CONNMAN_IPCONFIG_METHOD_DHCP: + __connman_dhcp_stop(network); + break; + } + __connman_service_ipconfig_indicate_state(service, CONNMAN_SERVICE_STATE_DISCONNECT, CONNMAN_IPCONFIG_TYPE_IPV4);