From: Jukka Rissanen Date: Mon, 24 Sep 2012 11:44:31 +0000 (+0300) Subject: ipconfig: Set default IPv6 method according to kernel IPv6 support X-Git-Tag: 1.8~77 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=f6b4a7c12c2a76525714e54c1ced0a85cd425626;p=platform%2Fupstream%2Fconnman.git 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. --- diff --git a/src/ipconfig.c b/src/ipconfig.c index 4d8c569..0c88fa5 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; }