summaryrefslogtreecommitdiff
path: root/lib/if2ip.c
diff options
context:
space:
mode:
authorGunter Knauf <gk@gknw.de>2008-12-30 08:05:38 +0000
committerGunter Knauf <gk@gknw.de>2008-12-30 08:05:38 +0000
commit1cc50d31f9962264fd78cdbe6a27dac10742dcd6 (patch)
tree29f86554facab9f8dfecbd59548161a7603bf9df /lib/if2ip.c
parent104377d718654947f42f8812b17d1d3127c843a0 (diff)
downloadcurl-1cc50d31f9962264fd78cdbe6a27dac10742dcd6.tar.gz
changed HAVE_SIN6_SCOPE_ID define to HAVE_SOCKADDR_IN6_SIN6_SCOPE_ID since just found that ares already uses this define.
Diffstat (limited to 'lib/if2ip.c')
-rw-r--r--lib/if2ip.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/if2ip.c b/lib/if2ip.c
index 74cd5266e..0e74042d2 100644
--- a/lib/if2ip.c
+++ b/lib/if2ip.c
@@ -86,10 +86,12 @@ char *Curl_if2ip(int af, const char *interface, char *buf, int buf_size)
char scope[12]="";
#ifdef ENABLE_IPV6
if (af == AF_INET6) {
- unsigned int scopeid;
+ unsigned int scopeid = 0;
addr = &((struct sockaddr_in6 *)iface->ifa_addr)->sin6_addr;
+#ifdef HAVE_SOCKADDR_IN6_SIN6_SCOPE_ID
/* Include the scope of this interface as part of the address */
scopeid = ((struct sockaddr_in6 *)iface->ifa_addr)->sin6_scope_id;
+#endif
if (scopeid)
snprintf(scope, sizeof(scope), "%%%u", scopeid);
}