ipconfig: Set method to OFF when the stored method is unknown
authorSamuel Ortiz <sameo@linux.intel.com>
Fri, 17 Dec 2010 18:51:35 +0000 (19:51 +0100)
committerSamuel Ortiz <sameo@linux.intel.com>
Fri, 17 Dec 2010 18:51:35 +0000 (19:51 +0100)
src/ipconfig.c

index 5a6132d..90b4f16 100644 (file)
@@ -1643,6 +1643,10 @@ int __connman_ipconfig_load(struct connman_ipconfig *ipconfig,
                        ipconfig->method = CONNMAN_IPCONFIG_METHOD_OFF;
        } else
                ipconfig->method = __connman_ipconfig_string2method(method);
+
+       if (ipconfig->method == CONNMAN_IPCONFIG_METHOD_UNKNOWN)
+               ipconfig->method = CONNMAN_IPCONFIG_METHOD_OFF;
+
        g_free(key);
 
        key = g_strdup_printf("%snetmask_prefixlen", prefix);