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.c15
1 files changed, 4 insertions, 11 deletions
diff --git a/ext/socket/getaddrinfo.c b/ext/socket/getaddrinfo.c
index 53656b4..d5ef517 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);