summaryrefslogtreecommitdiff
path: root/lib/if2ip.c
diff options
context:
space:
mode:
authorDan Fandrich <dan@coneharvesters.com>2008-12-04 06:24:00 +0000
committerDan Fandrich <dan@coneharvesters.com>2008-12-04 06:24:00 +0000
commit7abdc4b21811e2d52f49fcf1380c48ccd46b3cc0 (patch)
tree5b2cbcc7980e7262c81d0a013c13bd95fdfe1109 /lib/if2ip.c
parent479ddb1fee2fa5f7204a64742e9dcc2842d668dd (diff)
downloadcurl-7abdc4b21811e2d52f49fcf1380c48ccd46b3cc0.tar.gz
Fixed the getifaddrs version of Curl_if2ip to work on systems without IPv6
support (e.g. Minix)
Diffstat (limited to 'lib/if2ip.c')
-rw-r--r--lib/if2ip.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/if2ip.c b/lib/if2ip.c
index 842cd9947..74cd5266e 100644
--- a/lib/if2ip.c
+++ b/lib/if2ip.c
@@ -84,6 +84,7 @@ char *Curl_if2ip(int af, const char *interface, char *buf, int buf_size)
curl_strequal(iface->ifa_name, interface)) {
void *addr;
char scope[12]="";
+#ifdef ENABLE_IPV6
if (af == AF_INET6) {
unsigned int scopeid;
addr = &((struct sockaddr_in6 *)iface->ifa_addr)->sin6_addr;
@@ -93,6 +94,7 @@ char *Curl_if2ip(int af, const char *interface, char *buf, int buf_size)
snprintf(scope, sizeof(scope), "%%%u", scopeid);
}
else
+#endif
addr = &((struct sockaddr_in *)iface->ifa_addr)->sin_addr;
ip = (char *) Curl_inet_ntop(af, addr, buf, buf_size);
strlcat(buf, scope, buf_size);