Hi Samuel, ext Samuel Ortiz wrote: > Hi Jukka, > > On Fri, Jan 07, 2011 at 02:55:13PM +0200, Jukka Rissanen wrote: >> --- >> src/ipconfig.c | 9 +++++++++ >> 1 files changed, 9 insertions(+), 0 deletions(-) >> >> diff --git a/src/ipconfig.c b/src/ipconfig.c index 7a14c42..2c0ede6 >> 100644 --- a/src/ipconfig.c >> +++ b/src/ipconfig.c >> @@ -616,6 +616,15 @@ void __connman_ipconfig_deladdr(int index, int >> family, const char *label, ipdevice->address_list = >> g_slist_remove(ipdevice->address_list, ipaddress); >> >> + if (family == AF_INET6 && ipdevice->config_ipv6 && >> + ipdevice->config_ipv6->system && >> + ipdevice->config_ipv6->system->prefixlen == >> + ipaddress->prefixlen && >> + g_strcmp0(ipdevice->config_ipv6->system->local, >> + ipaddress->local) == 0) { >> + connman_ipaddress_clear(ipdevice->config_ipv6->system); + >> } >> + > Why do we need to do that for IPv6, and why can't we just do: > > if (family == AF_INET6) > connman_ipaddress_clear(ipaddress); >
The reason for the code is that if user sets IPv6 to OFF, then __connman_ipconfig_deladdr() will be called for each IPv6 address in the system. The patch removes the currently configured system address so that it won't be shown if the user gets services via dbus. So without the patch list-services would return IPv6 = { PrefixLength=64 Method=off Address=2001::1 } instead of IPv6 = { Method=off } which I think is a more proper thing to return in this case when Method is OFF. Jukka _______________________________________________ connman mailing list connman@connman.net http://lists.connman.net/listinfo/connman