summaryrefslogtreecommitdiff
path: root/libc/inet/getaddrinfo.c
diff options
context:
space:
mode:
authorPeter S. Mazinger <ps.m@gmx.net>2011-02-26 18:45:19 +0100
committerPeter S. Mazinger <ps.m@gmx.net>2011-03-03 18:22:48 +0100
commit9fa4711e364e9aa779d6b8d12220bbb63dbb1f3d (patch)
treeebc79b31b75241d0cf16de5c60d194cfcda00628 /libc/inet/getaddrinfo.c
parenta82ba03b6ff449bdfdae4ad360c2ab59bda09ef4 (diff)
guard IPv6 stuff
disable IPv6 related stuff if feature is disabled. Signed-off-by: Peter S. Mazinger <ps.m@gmx.net>
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);