From: Abtin Keshavarzian <abt...@nestlabs.com>

This is a quick fix for the issue where removal of an interface may
cause IPv6 to be disabled/enabled on other interfaces.
When removing an ipdevice in free_ipdevice(), it is ensured that the
ifname (which we get from connman_inet_ifname()) is not null,
before invoking set_ipv6_state(). If a null ifname is passed into
set_ipv6_state(), it will apply the change to all interfaces instead
of the intended one.
---
 src/ipconfig.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/src/ipconfig.c b/src/ipconfig.c
index ec1e826..0dc702b 100644
--- a/src/ipconfig.c
+++ b/src/ipconfig.c
@@ -399,8 +399,10 @@ static void free_ipdevice(gpointer data)
 
        g_free(ipdevice->address);
 
-       set_ipv6_state(ifname, ipdevice->ipv6_enabled);
-       set_ipv6_privacy(ifname, ipdevice->ipv6_privacy);
+       if (ifname) {
+               set_ipv6_state(ifname, ipdevice->ipv6_enabled);
+               set_ipv6_privacy(ifname, ipdevice->ipv6_privacy);
+       }
 
        g_free(ifname);
        g_free(ipdevice);
-- 
2.6.0.rc2.230.g3dd15c0

_______________________________________________
connman mailing list
connman@connman.net
https://lists.connman.net/mailman/listinfo/connman

Reply via email to