summaryrefslogtreecommitdiff
path: root/plugins
diff options
context:
space:
mode:
authorJukka Rissanen <jukka.rissanen@linux.intel.com>2013-03-25 14:58:56 (GMT)
committerPatrik Flykt <patrik.flykt@linux.intel.com>2013-03-27 14:00:09 (GMT)
commitff0d2b9c6e427035d5fdf1d412b80892294b6ead (patch)
tree2a71eb67315aa108a475b6178bd7f60fb5056f1b /plugins
parentec3eca317f9431dd394f62942c9a23404b6cecfe (diff)
downloadconnman-ff0d2b9c6e427035d5fdf1d412b80892294b6ead.zip
connman-ff0d2b9c6e427035d5fdf1d412b80892294b6ead.tar.gz
connman-ff0d2b9c6e427035d5fdf1d412b80892294b6ead.tar.bz2
provider: Set nameservers if we receive them from vpnd
If we receive nameservers from vpnd we must set them in provider. The connman_provider_set_nameservers() function needs changes because we get the nameservers as an array, it makes no sense to convert the array to string and then back to array.
Diffstat (limited to 'plugins')
-rw-r--r--plugins/vpn.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/plugins/vpn.c b/plugins/vpn.c
index 038a833..d33d7c1 100644
--- a/plugins/vpn.c
+++ b/plugins/vpn.c
@@ -643,6 +643,10 @@ static void add_connection(const char *path, DBusMessageIter *properties,
resolv_host_addr(data);
+ if (data->nameservers != NULL)
+ connman_provider_set_nameservers(data->provider,
+ data->nameservers);
+
if (data->connect_pending == TRUE)
connect_provider(data, data->cb_data);
@@ -1756,7 +1760,10 @@ static gboolean property_changed(DBusConnection *conn,
set_routes(data->provider,
CONNMAN_PROVIDER_ROUTE_USER);
} else if (g_str_equal(key, "Nameservers") == TRUE) {
- extract_nameservers(&value, data);
+ if (extract_nameservers(&value, data) == 0 &&
+ data->nameservers != NULL)
+ connman_provider_set_nameservers(data->provider,
+ data->nameservers);
}
if (ip_set == TRUE && err == 0) {