summaryrefslogtreecommitdiff
path: root/ext/socket/getaddrinfo.c
diff options
context:
space:
mode:
Diffstat (limited to 'ext/socket/getaddrinfo.c')
-rw-r--r--ext/socket/getaddrinfo.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/ext/socket/getaddrinfo.c b/ext/socket/getaddrinfo.c
index a6c26a8f0f..4f58a23d2d 100644
--- a/ext/socket/getaddrinfo.c
+++ b/ext/socket/getaddrinfo.c
@@ -480,7 +480,11 @@ getaddrinfo(hostname, servname, hints, res)
break;
#ifdef INET6
case AF_INET6:
+#ifdef HAVE_ADDR8
pfx = ((struct in6_addr *)pton)->s6_addr8[0];
+#else
+ pfx = ((struct in6_addr *)pton)->s6_addr[0];
+#endif
if (pfx == 0 || pfx == 0xfe || pfx == 0xff)
pai->ai_flags &= ~AI_CANONNAME;
break;