From: Dan Fandrich Date: Thu, 4 Dec 2008 06:24:00 +0000 (+0000) Subject: Fixed the getifaddrs version of Curl_if2ip to work on systems without IPv6 X-Git-Tag: upstream/7.37.1~6718 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=7abdc4b21811e2d52f49fcf1380c48ccd46b3cc0;p=platform%2Fupstream%2Fcurl.git Fixed the getifaddrs version of Curl_if2ip to work on systems without IPv6 support (e.g. Minix) --- diff --git a/CHANGES b/CHANGES index c052fc8..57aa101 100644 --- a/CHANGES +++ b/CHANGES @@ -6,6 +6,10 @@ Changelog +Daniel Fandrich (3 Dec 2008) +- Fixed the getifaddrs version of Curl_if2ip to work on systems without IPv6 + support (e.g. Minix) + Daniel Stenberg (3 Dec 2008) - Igor Novoseltsev filed bug #2351645 (http://curl.haxx.se/bug/view.cgi?id=2351645) that identified a problem with diff --git a/lib/if2ip.c b/lib/if2ip.c index 842cd99..74cd526 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);