diff options
author | Jukka Rissanen <jukka.rissanen@linux.intel.com> | 2013-03-25 16:58:56 +0200 |
---|---|---|
committer | Patrik Flykt <patrik.flykt@linux.intel.com> | 2013-03-27 16:00:09 +0200 |
commit | ff0d2b9c6e427035d5fdf1d412b80892294b6ead (patch) | |
tree | 2a71eb67315aa108a475b6178bd7f60fb5056f1b /plugins | |
parent | ec3eca317f9431dd394f62942c9a23404b6cecfe (diff) | |
download | connman-ff0d2b9c6e427035d5fdf1d412b80892294b6ead.tar.gz connman-ff0d2b9c6e427035d5fdf1d412b80892294b6ead.tar.bz2 connman-ff0d2b9c6e427035d5fdf1d412b80892294b6ead.zip |
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.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/plugins/vpn.c b/plugins/vpn.c index 038a8338..d33d7c1f 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) { |