From de96413b24937db8993a4eaee6ee03db9b9047e0 Mon Sep 17 00:00:00 2001 From: Tomasz Bursztyka Date: Thu, 29 Dec 2011 13:02:22 +0200 Subject: wispr: using only the nameservers from requested service --- src/wispr.c | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'src/wispr.c') diff --git a/src/wispr.c b/src/wispr.c index 84df2bc9..85ee857f 100644 --- a/src/wispr.c +++ b/src/wispr.c @@ -625,8 +625,10 @@ static int wispr_portal_detect(struct connman_wispr_portal_context *wp_context) { enum connman_service_type service_type; char *interface = NULL; + char **nameservers; int if_index; int err = 0; + int i; DBG("wispr/portal context %p", wp_context); DBG("service %p", wp_context->service); @@ -660,6 +662,12 @@ static int wispr_portal_detect(struct connman_wispr_portal_context *wp_context) goto done; } + nameservers = connman_service_get_nameservers(wp_context->service); + if (nameservers == NULL) { + err = -EINVAL; + goto done; + } + wp_context->web = g_web_new(if_index); if (wp_context->web == NULL) { err = -ENOMEM; @@ -674,6 +682,9 @@ static int wispr_portal_detect(struct connman_wispr_portal_context *wp_context) wp_context->status_url = STATUS_URL_IPV6; } + for (i = 0; nameservers[i] != NULL; i++) + g_web_add_nameserver(wp_context->web, nameservers[i]); + wp_context->token = connman_proxy_lookup(interface, wp_context->status_url, wp_context->service, -- cgit v1.2.3