6to4: Use the right interface index with gweb
authorTomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
Fri, 25 Nov 2011 11:03:05 +0000 (13:03 +0200)
committerSamuel Ortiz <sameo@linux.intel.com>
Mon, 28 Nov 2011 14:55:35 +0000 (15:55 +0100)
src/6to4.c

index 35540bf..0dfcbf7 100644 (file)
@@ -396,8 +396,8 @@ static gboolean web_result(GWebResult *result, gpointer user_data)
 static int init_6to4(struct in_addr *ip4addr)
 {
        unsigned int a, b, c, d;
+       int ret, if_index;
        in_addr_t addr;
-       int ret;
 
        DBG("");
 
@@ -426,9 +426,13 @@ static int init_6to4(struct in_addr *ip4addr)
        if (ret)
                goto error;
 
+       if_index = connman_inet_ifindex("tun6to4");
+       if (if_index < 0)
+               goto error;
+
        /* We try to verify that connectivity through tunnel works ok.
         */
-       web = g_web_new(0);
+       web = g_web_new(if_index);
        if (web == NULL)
                goto error;