diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2009-12-30 20:56:41 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2009-12-30 20:56:41 +0000 |
commit | 1069e0f33569071d43dff77bdca1064a8acb1a0f (patch) | |
tree | 1d91ab9d912a0879c361699000225c0d570429fa /ext/socket/getaddrinfo.c | |
parent | 6e4df2896f6b5ca801e330954e4a6dc1eb0fd571 (diff) | |
download | ruby-1069e0f33569071d43dff77bdca1064a8acb1a0f.tar.gz |
* 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
Diffstat (limited to 'ext/socket/getaddrinfo.c')
-rw-r--r-- | ext/socket/getaddrinfo.c | 15 |
1 files changed, 4 insertions, 11 deletions
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); |