summaryrefslogtreecommitdiff
path: root/vpn
diff options
context:
space:
mode:
authorJukka Rissanen <jukka.rissanen@linux.intel.com>2013-03-25 14:58:58 (GMT)
committerPatrik Flykt <patrik.flykt@linux.intel.com>2013-03-27 14:00:22 (GMT)
commit617d99e56772a6cdb89f833c4334a83f17c42f9b (patch)
treeb0be914b8b340c79fdf86026cb71a57b63a6b7be /vpn
parenta1ef3bc2f851d56d1899c0eb5676e491b2a98ff5 (diff)
downloadconnman-617d99e56772a6cdb89f833c4334a83f17c42f9b.zip
connman-617d99e56772a6cdb89f833c4334a83f17c42f9b.tar.gz
connman-617d99e56772a6cdb89f833c4334a83f17c42f9b.tar.bz2
vpn-provider: Nameservers were not sent to connmand vpn plugin
We got some nameservers from VPN server but we never sent the nameserver list to connmand vpn plugin. Fixes BMC#25966
Diffstat (limited to 'vpn')
-rw-r--r--vpn/vpn-provider.c48
1 files changed, 27 insertions, 21 deletions
diff --git a/vpn/vpn-provider.c b/vpn/vpn-provider.c
index de3931f..d591605 100644
--- a/vpn/vpn-provider.c
+++ b/vpn/vpn-provider.c
@@ -1234,6 +1234,27 @@ static const char *state2string(enum vpn_provider_state state)
return NULL;
}
+static void append_nameservers(DBusMessageIter *iter, char **servers)
+{
+ int i;
+
+ DBG("%p", servers);
+
+ for (i = 0; servers[i] != NULL; i++) {
+ DBG("servers[%d] %s", i, servers[i]);
+ dbus_message_iter_append_basic(iter,
+ DBUS_TYPE_STRING, &servers[i]);
+ }
+}
+
+static void append_dns(DBusMessageIter *iter, void *user_data)
+{
+ struct vpn_provider *provider = user_data;
+
+ if (provider->nameservers != NULL)
+ append_nameservers(iter, provider->nameservers);
+}
+
static int provider_indicate_state(struct vpn_provider *provider,
enum vpn_provider_state state)
{
@@ -1261,6 +1282,12 @@ static int provider_indicate_state(struct vpn_provider *provider,
connman_dbus_property_changed_dict(provider->path,
VPN_CONNECTION_INTERFACE, "IPv6",
append_ipv6, provider);
+
+ connman_dbus_property_changed_array(provider->path,
+ VPN_CONNECTION_INTERFACE,
+ "Nameservers",
+ DBUS_TYPE_STRING,
+ append_dns, provider);
}
if (old_state != state)
@@ -1278,27 +1305,6 @@ static int provider_indicate_state(struct vpn_provider *provider,
return 0;
}
-static void append_nameservers(DBusMessageIter *iter, char **servers)
-{
- int i;
-
- DBG("%p", servers);
-
- for (i = 0; servers[i] != NULL; i++) {
- DBG("servers[%d] %s", i, servers[i]);
- dbus_message_iter_append_basic(iter,
- DBUS_TYPE_STRING, &servers[i]);
- }
-}
-
-static void append_dns(DBusMessageIter *iter, void *user_data)
-{
- struct vpn_provider *provider = user_data;
-
- if (provider->nameservers != NULL)
- append_nameservers(iter, provider->nameservers);
-}
-
static void append_state(DBusMessageIter *iter,
struct vpn_provider *provider)
{