summaryrefslogtreecommitdiff
path: root/plugins
diff options
context:
space:
mode:
authorDaniel Wagner <daniel.wagner@bmw-carit.de>2012-08-10 09:59:04 (GMT)
committerPatrik Flykt <patrik.flykt@linux.intel.com>2012-08-14 06:02:19 (GMT)
commit5702348938d6a6cf680ec503cc02a532f24c9910 (patch)
tree062500218984b025dec84e6c3897eec911585951 /plugins
parent677303d07342589f22ce9f937ad9cf53d00394df (diff)
downloadconnman-5702348938d6a6cf680ec503cc02a532f24c9910.zip
connman-5702348938d6a6cf680ec503cc02a532f24c9910.tar.gz
connman-5702348938d6a6cf680ec503cc02a532f24c9910.tar.bz2
ofono: Set IPv6 nameservers
Diffstat (limited to 'plugins')
-rw-r--r--plugins/ofono.c19
1 files changed, 17 insertions, 2 deletions
diff --git a/plugins/ofono.c b/plugins/ofono.c
index 87bb956..2122b85 100644
--- a/plugins/ofono.c
+++ b/plugins/ofono.c
@@ -259,6 +259,7 @@ static void set_connected(struct modem_data *modem)
struct connman_service *service;
connman_bool_t setip = FALSE;
enum connman_ipconfig_method method;
+ char *nameservers;
int index;
DBG("%s", modem->path);
@@ -289,8 +290,6 @@ static void set_connected(struct modem_data *modem)
if (method == CONNMAN_IPCONFIG_METHOD_FIXED) {
connman_network_set_ipaddress(modem->network,
modem->context->ipv4_address);
- connman_network_set_nameservers(modem->network,
- modem->context->ipv4_nameservers);
}
method = modem->context->ipv6_method;
@@ -302,6 +301,22 @@ static void set_connected(struct modem_data *modem)
setip = TRUE;
}
+ /* Set the nameservers */
+ if (modem->context->ipv4_nameservers != NULL &&
+ modem->context->ipv6_nameservers != NULL) {
+ nameservers = g_strdup_printf("%s %s",
+ modem->context->ipv4_nameservers,
+ modem->context->ipv6_nameservers);
+ connman_network_set_nameservers(modem->network, nameservers);
+ g_free(nameservers);
+ } else if (modem->context->ipv4_nameservers != NULL) {
+ connman_network_set_nameservers(modem->network,
+ modem->context->ipv4_nameservers);
+ } else if (modem->context->ipv6_nameservers != NULL) {
+ connman_network_set_nameservers(modem->network,
+ modem->context->ipv6_nameservers);
+ }
+
if (setip == TRUE)
connman_network_set_connected(modem->network, TRUE);
}