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.
---
 src/network.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

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);
-- 
1.7.1

_______________________________________________
connman mailing list
connman@connman.net
http://lists.connman.net/listinfo/connman

Reply via email to