summaryrefslogtreecommitdiff
path: root/src/wpad.c
diff options
context:
space:
mode:
authorJukka Rissanen <jukka.rissanen@linux.intel.com>2012-01-03 14:36:28 +0200
committerDaniel Wagner <daniel.wagner@bmw-carit.de>2012-01-05 11:09:16 +0100
commit70ce3cd0a6130605a5f3c1f4f334bd501bece184 (patch)
tree70b21b96f9c5b9e8b7b534c7da0def4bf8650150 /src/wpad.c
parent097f0059d972e639d75ac7d0b27db759fbf05e5c (diff)
downloadconnman-70ce3cd0a6130605a5f3c1f4f334bd501bece184.tar.gz
connman-70ce3cd0a6130605a5f3c1f4f334bd501bece184.tar.bz2
connman-70ce3cd0a6130605a5f3c1f4f334bd501bece184.zip
service: Return all system defined nameservers when asked
The connman_service_get_nameservers() is changed to return all system defined nameservers. This means that the function now returns an allocated array of all nameservers and caller must deallocate the returned array. The change is needed so that we can combine the nameservers that are set by DHCP code and the IPv6 nameservers that are set by router advertisements.
Diffstat (limited to 'src/wpad.c')
-rw-r--r--src/wpad.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/wpad.c b/src/wpad.c
index dd25c7c6..e6d77e7d 100644
--- a/src/wpad.c
+++ b/src/wpad.c
@@ -147,12 +147,15 @@ int __connman_wpad_start(struct connman_service *service)
return -EINVAL;
wpad = g_try_new0(struct connman_wpad, 1);
- if (wpad == NULL)
+ if (wpad == NULL) {
+ g_strfreev(nameservers);
return -ENOMEM;
+ }
wpad->service = service;
wpad->resolv = g_resolv_new(index);
if (wpad->resolv == NULL) {
+ g_strfreev(nameservers);
g_free(wpad);
return -ENOMEM;
}
@@ -163,6 +166,8 @@ int __connman_wpad_start(struct connman_service *service)
for (i = 0; nameservers[i] != NULL; i++)
g_resolv_add_nameserver(wpad->resolv, nameservers[i], 53, 0);
+ g_strfreev(nameservers);
+
wpad->hostname = g_strdup_printf("wpad.%s", domainname);
DBG("hostname %s", wpad->hostname);