summaryrefslogtreecommitdiff
path: root/src/ipconfig.c
diff options
context:
space:
mode:
authorJukka Rissanen <jukka.rissanen@linux.intel.com>2012-09-24 14:44:31 +0300
committerPatrik Flykt <patrik.flykt@linux.intel.com>2012-09-25 16:55:33 +0300
commitf6b4a7c12c2a76525714e54c1ced0a85cd425626 (patch)
tree5c38da83be26e87429e65e7bb081553f9c4820da /src/ipconfig.c
parent37f818606d6fc7defaa98fb5a611bcdbc798368a (diff)
downloadconnman-f6b4a7c12c2a76525714e54c1ced0a85cd425626.tar.gz
connman-f6b4a7c12c2a76525714e54c1ced0a85cd425626.tar.bz2
connman-f6b4a7c12c2a76525714e54c1ced0a85cd425626.zip
ipconfig: Set default IPv6 method according to kernel IPv6 support
If kernel does not support IPv6, then turn default ipconfig method OFF. If kernel supports IPv6, then the default is AUTO meaning that we try to send router solicitation messages.
Diffstat (limited to 'src/ipconfig.c')
-rw-r--r--src/ipconfig.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/ipconfig.c b/src/ipconfig.c
index 4d8c569e..0c88fa53 100644
--- a/src/ipconfig.c
+++ b/src/ipconfig.c
@@ -89,6 +89,7 @@ struct connman_ipdevice {
static GHashTable *ipdevice_hash = NULL;
static GList *ipconfig_list = NULL;
+static connman_bool_t is_ipv6_supported = FALSE;
struct connman_ipaddress *connman_ipaddress_alloc(int family)
{
@@ -1266,7 +1267,11 @@ static struct connman_ipconfig *create_ipv6config(int index)
ipv6config->index = index;
ipv6config->enabled = FALSE;
ipv6config->type = CONNMAN_IPCONFIG_TYPE_IPV6;
- ipv6config->method = CONNMAN_IPCONFIG_METHOD_AUTO;
+
+ if (is_ipv6_supported == FALSE)
+ ipv6config->method = CONNMAN_IPCONFIG_METHOD_OFF;
+ else
+ ipv6config->method = CONNMAN_IPCONFIG_METHOD_AUTO;
ipdevice = g_hash_table_lookup(ipdevice_hash, GINT_TO_POINTER(index));
if (ipdevice != NULL)
@@ -1280,7 +1285,8 @@ static struct connman_ipconfig *create_ipv6config(int index)
ipv6config->system = connman_ipaddress_alloc(AF_INET6);
- DBG("ipconfig %p", ipv6config);
+ DBG("ipconfig %p method %s", ipv6config,
+ __connman_ipconfig_method2string(ipv6config->method));
return ipv6config;
}
@@ -2406,6 +2412,8 @@ int __connman_ipconfig_init(void)
ipdevice_hash = g_hash_table_new_full(g_direct_hash, g_direct_equal,
NULL, free_ipdevice);
+ is_ipv6_supported = connman_inet_is_ipv6_supported();
+
return 0;
}