From 4abda5f82f916f45f4ab9b695c9f76969da9db55 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Wed, 22 Jun 2011 13:37:49 +0300 Subject: network: Clear IPv6 autoconfigured routes when disconnected. --- src/network.c | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'src/network.c') diff --git a/src/network.c b/src/network.c index 0ae77ca9..ac7bd075 100644 --- a/src/network.c +++ b/src/network.c @@ -1104,6 +1104,17 @@ static gboolean set_connected(gpointer user_data) __connman_ipconfig_address_unset(ipconfig_ipv4); __connman_ipconfig_address_unset(ipconfig_ipv6); + /* + * Special handling for IPv6 autoconfigured address. + * The simplest way to remove autoconfigured routes is to + * disable IPv6 temporarily so that kernel will do the cleanup + * automagically. + */ + if (ipv6_method == CONNMAN_IPCONFIG_METHOD_AUTO) { + __connman_ipconfig_disable_ipv6(ipconfig_ipv6); + __connman_ipconfig_enable_ipv6(ipconfig_ipv6); + } + __connman_service_indicate_state(service, CONNMAN_SERVICE_STATE_IDLE, CONNMAN_IPCONFIG_TYPE_IPV4); -- cgit v1.2.3