From 8393bb169f348d55133e828748ff87860e93cad0 Mon Sep 17 00:00:00 2001 From: Lucas De Marchi Date: Thu, 18 Feb 2010 08:58:53 -0200 Subject: [PATCH] Fix configuration loading for unknown service In case a service is unknown, the expected behavior is that it uses dhcp. Currently, method will be left blank and thus connman will not be able to connect to that service unless method is explicitly set through IPv4.Configuration property. --- src/ipconfig.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/ipconfig.c b/src/ipconfig.c index 9e1dbf4..91ce244 100644 --- a/src/ipconfig.c +++ b/src/ipconfig.c @@ -1238,7 +1238,10 @@ int __connman_ipconfig_load(struct connman_ipconfig *ipconfig, key = g_strdup_printf("%smethod", prefix); method = g_key_file_get_string(keyfile, identifier, key, NULL); - ipconfig->method = __connman_ipconfig_string2method(method); + if (method == NULL) + ipconfig->method = CONNMAN_IPCONFIG_METHOD_DHCP; + else + ipconfig->method = __connman_ipconfig_string2method(method); g_free(key); key = g_strdup_printf("%snetmask_prefixlen", prefix); -- 2.7.4