From a3e8f3674f242825b2911fe625d842ec6674859a Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Mon, 21 Jan 2013 14:39:31 +0200 Subject: [PATCH] ipconfig: IPv6 was enabled too early When enabling IPv6 ipconfig, we enable kernel IPv6 support too early. The ipconfig might get unreffed which will disable ipconfig and thus disable kernel IPv6 support. By moving kernel IPv6 enabling after the ipconfig unref call, we make sure that IPv6 kernel support is properly enabled. This is related to fix in commit d479904ecaa2bd9 --- src/ipconfig.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/ipconfig.c b/src/ipconfig.c index b400894..9ca3316 100644 --- a/src/ipconfig.c +++ b/src/ipconfig.c @@ -1556,7 +1556,6 @@ int __connman_ipconfig_enable(struct connman_ipconfig *ipconfig) if (ipdevice->config_ipv6 == ipconfig) return -EALREADY; type = CONNMAN_IPCONFIG_TYPE_IPV6; - enable_ipv6(ipconfig); } else return -EINVAL; @@ -1584,9 +1583,11 @@ int __connman_ipconfig_enable(struct connman_ipconfig *ipconfig) if (type == CONNMAN_IPCONFIG_TYPE_IPV4) ipdevice->config_ipv4 = __connman_ipconfig_ref(ipconfig); - else if (type == CONNMAN_IPCONFIG_TYPE_IPV6) + else if (type == CONNMAN_IPCONFIG_TYPE_IPV6) { ipdevice->config_ipv6 = __connman_ipconfig_ref(ipconfig); + enable_ipv6(ipdevice->config_ipv6); + } ipconfig_list = g_list_append(ipconfig_list, ipconfig); if (ipdevice->flags & IFF_UP) -- 2.7.4