summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJaehyun Kim <jeik01.kim@samsung.com>2017-09-19 19:59:52 +0900
committerJaehyun Kim <jeik01.kim@samsung.com>2017-09-19 20:07:28 +0900
commit4541295e8391b08d9922548f27e4a8836280fd45 (patch)
tree5cc47cda30a9bc6c85d88895f1a82e3b547e54f0
parent2d1923155d6c76c04af6b10efe6b0879258f0121 (diff)
downloadconnman-submit/tizen/20170920.020838.tar.gz
connman-submit/tizen/20170920.020838.tar.bz2
connman-submit/tizen/20170920.020838.zip
[Upstream] ipconfig: Ensure ifname is not NULL when setting IPv6 statesubmit/tizen/20170920.020838accepted/tizen/unified/20170921.072215
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: I2b0b6494e3c2d4a80e7a8e2012f274987f6e8142 Signed-off-by: Jaehyun Kim <jeik01.kim@samsung.com>
-rwxr-xr-xsrc/ipconfig.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/ipconfig.c b/src/ipconfig.c
index 700384fe..ded1c11c 100755
--- a/src/ipconfig.c
+++ b/src/ipconfig.c
@@ -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);