From: Jukka Rissanen Date: Wed, 22 Jun 2011 10:37:47 +0000 (+0300) Subject: network: Clear interface addresses after removing gateway address. X-Git-Tag: accepted/2.0alpha-wayland/20121110.002834~1360 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=639dc229173a36d3c237d97c63eef1bd5cdfc6e4;p=profile%2Fivi%2Fconnman.git network: Clear interface addresses after removing gateway address. The reason for this patch is that service disconnect code path is different from service change code path. In disconnect, the __connman_ipconfig_address_remove() is called which clears the addresses from interface. When changing from one service to another, the function __connman_service_disconnect() is not called and thus the interface address is not removed. We cannot call __connman_ipconfig_address_remove() yet at this point because it would clear addresses from internal data structures so we use __connman_ipconfig_address_unset() instead. --- diff --git a/src/network.c b/src/network.c index 4abcb09..0ae77ca 100644 --- a/src/network.c +++ b/src/network.c @@ -1101,6 +1101,9 @@ static gboolean set_connected(gpointer user_data) __connman_connection_gateway_remove(service, CONNMAN_IPCONFIG_TYPE_ALL); + __connman_ipconfig_address_unset(ipconfig_ipv4); + __connman_ipconfig_address_unset(ipconfig_ipv6); + __connman_service_indicate_state(service, CONNMAN_SERVICE_STATE_IDLE, CONNMAN_IPCONFIG_TYPE_IPV4);