summaryrefslogtreecommitdiff
path: root/ares__get_hostent.c
diff options
context:
space:
mode:
authorYang Tse <yangsita@gmail.com>2010-03-05 20:01:47 (GMT)
committerYang Tse <yangsita@gmail.com>2010-03-05 20:01:47 (GMT)
commit8fe746fcf2d5b54242a828840ccac630f7a4075a (patch)
tree0ae06cf5be407aea2129f1b47c59c1f433d425db /ares__get_hostent.c
parent249fc61b8cf1848c4444bef60fc6248930bd0d20 (diff)
downloadc-ares-8fe746fcf2d5b54242a828840ccac630f7a4075a.zip
c-ares-8fe746fcf2d5b54242a828840ccac630f7a4075a.tar.gz
c-ares-8fe746fcf2d5b54242a828840ccac630f7a4075a.tar.bz2
Added IPv6 name servers support
Diffstat (limited to 'ares__get_hostent.c')
-rw-r--r--ares__get_hostent.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/ares__get_hostent.c b/ares__get_hostent.c
index 18d3009..caa7f79 100644
--- a/ares__get_hostent.c
+++ b/ares__get_hostent.c
@@ -1,6 +1,6 @@
/* $Id$ */
-/* Copyright 1998, 2009 by the Massachusetts Institute of Technology.
+/* Copyright 1998, 2010 by the Massachusetts Institute of Technology.
*
* Permission to use, copy, modify, and distribute this
* software and its documentation for any purpose and without
@@ -146,7 +146,7 @@ int ares__get_hostent(FILE *fp, int family, struct hostent **host)
{
/* Actual network address family and length. */
addr.family = AF_INET;
- addrlen = sizeof(struct in_addr);
+ addrlen = sizeof(addr.addrV4);
}
}
if ((family == AF_INET6) || ((family == AF_UNSPEC) && (!addrlen)))
@@ -155,7 +155,7 @@ int ares__get_hostent(FILE *fp, int family, struct hostent **host)
{
/* Actual network address family and length. */
addr.family = AF_INET6;
- addrlen = sizeof(struct in6_addr);
+ addrlen = sizeof(addr.addrV6);
}
}
if (!addrlen)
@@ -189,9 +189,9 @@ int ares__get_hostent(FILE *fp, int family, struct hostent **host)
if (!hostent->h_addr_list[0])
break;
if (addr.family == AF_INET)
- memcpy(hostent->h_addr_list[0], &addr.addrV4, sizeof(struct in_addr));
+ memcpy(hostent->h_addr_list[0], &addr.addrV4, sizeof(addr.addrV4));
else
- memcpy(hostent->h_addr_list[0], &addr.addrV6, sizeof(struct in6_addr));
+ memcpy(hostent->h_addr_list[0], &addr.addrV6, sizeof(addr.addrV6));
/* Copy aliases. */
hostent->h_aliases = malloc((naliases + 1) * sizeof(char *));