summaryrefslogtreecommitdiff
path: root/ext/socket/getaddrinfo.c
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2003-09-02 05:12:39 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2003-09-02 05:12:39 +0000
commit05bb6b505c1be3169a9c1e2bdd18c0c0ade0e9d4 (patch)
tree93576a6e8ac68c69923e5b1946c64e257647c067 /ext/socket/getaddrinfo.c
parent9388ed284d600f2225a745dfb3edb6ac1758fdb8 (diff)
* ext/socket/extconf.rb: check s6_addr8 in in6_addr (Tru64 UNIX).
the patch is submitted by nmu <nmu@users.sourceforge.jp>. * ext/socket/getaddrinfo.c (getaddrinfo): should use in6_addr8 on some platforms. * ext/socket/getnameinfo.c (getnameinfo): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4481 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
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 a6c26a8..4f58a23 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;