summaryrefslogtreecommitdiff
path: root/src/network.c
diff options
context:
space:
mode:
authorJukka Rissanen <jukka.rissanen@linux.intel.com>2011-06-22 13:37:47 +0300
committerSamuel Ortiz <sameo@linux.intel.com>2011-06-27 16:15:09 +0200
commit639dc229173a36d3c237d97c63eef1bd5cdfc6e4 (patch)
tree263b1f8986ac6b3ff0505c93b14e7254f5e527e0 /src/network.c
parent80de85a6242c7b2957401dbf75520862798b8d16 (diff)
downloadconnman-639dc229173a36d3c237d97c63eef1bd5cdfc6e4.tar.gz
connman-639dc229173a36d3c237d97c63eef1bd5cdfc6e4.tar.bz2
connman-639dc229173a36d3c237d97c63eef1bd5cdfc6e4.zip
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.
Diffstat (limited to 'src/network.c')
-rw-r--r--src/network.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/network.c b/src/network.c
index 4abcb09a..0ae77ca9 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);