[Upstream] ipconfig: Ensure ifname is not NULL when setting IPv6 state 21/151021/2 accepted/tizen/4.0/unified/20170921.073336 submit/tizen_4.0/20170920.021207
authorJaehyun Kim <jeik01.kim@samsung.com>
Tue, 19 Sep 2017 10:59:52 +0000 (19:59 +0900)
committerJaehyun Kim <jeik01.kim@samsung.com>
Tue, 19 Sep 2017 11:03:45 +0000 (20:03 +0900)
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.

Change-Id: Iefab1e1c87d2f08d1b73c80ec51dbdfcb3238fad
Signed-off-by: Jaehyun Kim <jeik01.kim@samsung.com>
src/ipconfig.c

index 700384f..ded1c11 100755 (executable)
@@ -404,8 +404,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);