diff options
author | Jukka Rissanen <jukka.rissanen@linux.intel.com> | 2013-01-21 14:39:31 +0200 |
---|---|---|
committer | Patrik Flykt <patrik.flykt@linux.intel.com> | 2013-01-24 12:08:17 +0200 |
commit | a3e8f3674f242825b2911fe625d842ec6674859a (patch) | |
tree | 9d0d9f868cb15abed692d4bf7a475f0203d490b1 /src/ipconfig.c | |
parent | c1445c100e2523fb4d8fcdf8a3cc0c1cd6769e4a (diff) | |
download | connman-a3e8f3674f242825b2911fe625d842ec6674859a.tar.gz connman-a3e8f3674f242825b2911fe625d842ec6674859a.tar.bz2 connman-a3e8f3674f242825b2911fe625d842ec6674859a.zip |
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
Diffstat (limited to 'src/ipconfig.c')
-rw-r--r-- | src/ipconfig.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/ipconfig.c b/src/ipconfig.c index b4008945..9ca33161 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) |