summaryrefslogtreecommitdiff
path: root/libc/inet/getaddrinfo.c
diff options
context:
space:
mode:
Diffstat (limited to 'libc/inet/getaddrinfo.c')
-rw-r--r--libc/inet/getaddrinfo.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/libc/inet/getaddrinfo.c b/libc/inet/getaddrinfo.c
index cdfdb72cf..b3435a8b2 100644
--- a/libc/inet/getaddrinfo.c
+++ b/libc/inet/getaddrinfo.c
@@ -639,9 +639,13 @@ gaih_inet(const char *name, const struct gaih_service *service,
tmpbuflen *= 2;
tmpbuf = alloca(tmpbuflen);
rc = gethostbyaddr_r(at2->addr,
+#ifdef __UCLIBC_HAS_IPV6__
((at2->family == AF_INET6)
? sizeof(struct in6_addr)
: sizeof(struct in_addr)),
+#else
+ sizeof(struct in_addr),
+#endif
at2->family,
&th, tmpbuf, tmpbuflen,
&h, &herrno);