From ac9b140f8dd99d5aa13dae02f6903a4b7f9cfc4c Mon Sep 17 00:00:00 2001 From: Tomasz Bursztyka Date: Fri, 25 Nov 2011 13:03:04 +0200 Subject: wispr: Use the right interface index with gweb --- src/wispr.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src/wispr.c') diff --git a/src/wispr.c b/src/wispr.c index 0e05f9d5..64b90708 100644 --- a/src/wispr.c +++ b/src/wispr.c @@ -627,6 +627,7 @@ static int wispr_portal_detect(struct connman_wispr_portal_context *wp_context) { enum connman_service_type service_type; char *interface = NULL; + int if_index; int err = 0; DBG("wispr/portal context %p", wp_context); @@ -655,7 +656,11 @@ static int wispr_portal_detect(struct connman_wispr_portal_context *wp_context) DBG("interface %s", interface); - wp_context->web = g_web_new(0); + if_index = connman_inet_ifindex(interface); + if (if_index < 0) + return -EINVAL; + + wp_context->web = g_web_new(if_index); if (wp_context->web == NULL) { err = -ENOMEM; goto done; -- cgit v1.2.3