summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJukka Rissanen <jukka.rissanen@linux.intel.com>2011-12-09 10:42:22 +0200
committerSamuel Ortiz <sameo@linux.intel.com>2011-12-16 20:06:04 +0100
commitd8719c0ac57cb019286e3cfc6886244d8d7ecd02 (patch)
tree2da36f0344429cc8706dda4ca673e46d3dc2168d
parent7999a1fc4c6f695674d9510e9c18790748f5e4e5 (diff)
downloadconnman-d8719c0ac57cb019286e3cfc6886244d8d7ecd02.tar.gz
connman-d8719c0ac57cb019286e3cfc6886244d8d7ecd02.tar.bz2
connman-d8719c0ac57cb019286e3cfc6886244d8d7ecd02.zip
ipconfig: Make IPv6 method AUTO by default
This is done so that if the method is not found in settings file, then we enable IPv6 by default.
-rw-r--r--src/ipconfig.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/ipconfig.c b/src/ipconfig.c
index f817699f..4a83efbf 100644
--- a/src/ipconfig.c
+++ b/src/ipconfig.c
@@ -2161,10 +2161,17 @@ int __connman_ipconfig_load(struct connman_ipconfig *ipconfig,
key = g_strdup_printf("%smethod", prefix);
method = g_key_file_get_string(keyfile, identifier, key, NULL);
if (method == NULL) {
- if (ipconfig->type == CONNMAN_IPCONFIG_TYPE_IPV4)
+ switch (ipconfig->type) {
+ case CONNMAN_IPCONFIG_TYPE_IPV4:
ipconfig->method = CONNMAN_IPCONFIG_METHOD_DHCP;
- else
+ break;
+ case CONNMAN_IPCONFIG_TYPE_IPV6:
+ ipconfig->method = CONNMAN_IPCONFIG_METHOD_AUTO;
+ break;
+ case CONNMAN_IPCONFIG_TYPE_UNKNOWN:
ipconfig->method = CONNMAN_IPCONFIG_METHOD_OFF;
+ break;
+ }
} else
ipconfig->method = __connman_ipconfig_string2method(method);