ipconfig: Make IPv6 method AUTO by default
authorJukka Rissanen <jukka.rissanen@linux.intel.com>
Fri, 9 Dec 2011 08:42:22 +0000 (10:42 +0200)
committerSamuel Ortiz <sameo@linux.intel.com>
Fri, 16 Dec 2011 19:06:04 +0000 (20:06 +0100)
This is done so that if the method is not found
in settings file, then we enable IPv6 by default.

src/ipconfig.c

index f817699..4a83efb 100644 (file)
@@ -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);