From 1069e0f33569071d43dff77bdca1064a8acb1a0f Mon Sep 17 00:00:00 2001 From: nobu Date: Wed, 30 Dec 2009 20:56:41 +0000 Subject: * ext/socket/extconf.rb: fix for wide-getaddrinfo option. * ext/socket/addrinfo.c: rename {addr,name}info functions to ensure those are used on darwin. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26209 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ext/socket/getaddrinfo.c | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) (limited to 'ext/socket/getaddrinfo.c') diff --git a/ext/socket/getaddrinfo.c b/ext/socket/getaddrinfo.c index 53656b4c02..d5ef517943 100644 --- a/ext/socket/getaddrinfo.c +++ b/ext/socket/getaddrinfo.c @@ -83,10 +83,6 @@ #include "addrinfo.h" #include "sockport.h" -#if defined(__KAME__) && defined(INET6) -# define FAITH -#endif - #define SUCCESS 0 #define ANY 0 #define YES 1 @@ -482,11 +478,7 @@ getaddrinfo(const char *hostname, const char *servname, const struct addrinfo *h 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; @@ -651,9 +643,10 @@ get_addr(const char *hostname, int af, struct addrinfo **res, struct addrinfo *p GET_AI(cur->ai_next, &afdl[N_INET6], ap, port); in6 = &((struct sockaddr_in6 *)cur->ai_next->ai_addr)->sin6_addr; - memcpy(&in6->s6_addr32[0], &faith_prefix, - sizeof(struct in6_addr) - sizeof(struct in_addr)); - memcpy(&in6->s6_addr32[3], ap, sizeof(struct in_addr)); + memcpy(&in6->s6_addr, &faith_prefix, + sizeof(struct in6_addr) - sizeof(struct in_addr)); + memcpy(&in6->s6_addr + sizeof(struct in_addr), ap, + sizeof(struct in_addr)); } else #endif /* FAITH */ GET_AI(cur->ai_next, afd, ap, port); -- cgit v1.2.1