summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLucas De Marchi <lucas.demarchi@profusion.mobi>2010-02-18 08:58:53 -0200
committerMarcel Holtmann <marcel@holtmann.org>2010-02-18 09:13:03 -0800
commit8393bb169f348d55133e828748ff87860e93cad0 (patch)
tree595fa8f11c58e6f335d028d12e87329feba9155e
parentfb02febb39a318a1e4d846956932ea24a88423d7 (diff)
downloadconnman-8393bb169f348d55133e828748ff87860e93cad0.tar.gz
connman-8393bb169f348d55133e828748ff87860e93cad0.tar.bz2
connman-8393bb169f348d55133e828748ff87860e93cad0.zip
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.
-rw-r--r--src/ipconfig.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/ipconfig.c b/src/ipconfig.c
index 9e1dbf48..91ce2440 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);