summaryrefslogtreecommitdiff
path: root/ares_gethostbyname.c
diff options
context:
space:
mode:
Diffstat (limited to 'ares_gethostbyname.c')
-rw-r--r--ares_gethostbyname.c24
1 files changed, 8 insertions, 16 deletions
diff --git a/ares_gethostbyname.c b/ares_gethostbyname.c
index ad89dc2..2b27b2e 100644
--- a/ares_gethostbyname.c
+++ b/ares_gethostbyname.c
@@ -1,5 +1,5 @@
-/* Copyright 1998 by the Massachusetts Institute of Technology.
+/* Copyright 1998, 2011, 2013 by the Massachusetts Institute of Technology.
*
* Permission to use, copy, modify, and distribute this
* software and its documentation for any purpose and without
@@ -16,9 +16,6 @@
#include "ares_setup.h"
-#ifdef HAVE_SYS_SOCKET_H
-# include <sys/socket.h>
-#endif
#ifdef HAVE_NETINET_IN_H
# include <netinet/in.h>
#endif
@@ -37,18 +34,15 @@
# include <arpa/nameser_compat.h>
#endif
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <ctype.h>
#ifdef HAVE_STRINGS_H
#include <strings.h>
#endif
#include "ares.h"
-#include "inet_net_pton.h"
+#include "ares_inet_net_pton.h"
#include "bitncmp.h"
#include "ares_platform.h"
+#include "ares_nowarn.h"
#include "ares_private.h"
#ifdef WATT32
@@ -300,7 +294,7 @@ static int fake_hostent(const char *name, int family,
/* Fill in the rest of the host structure and terminate the query. */
addrs[1] = NULL;
hostent.h_aliases = aliases;
- hostent.h_addrtype = family;
+ hostent.h_addrtype = aresx_sitoss(family);
hostent.h_addr_list = addrs;
callback(arg, ARES_SUCCESS, 0, &hostent);
@@ -466,8 +460,8 @@ static int get_address_index(const struct in_addr *addr,
}
else
{
- if (!ares_bitncmp(&addr->s_addr, &sortlist[i].addrV4.s_addr,
- sortlist[i].mask.bits))
+ if (!ares__bitncmp(&addr->s_addr, &sortlist[i].addrV4.s_addr,
+ sortlist[i].mask.bits))
break;
}
}
@@ -514,10 +508,8 @@ static int get6_address_index(const struct ares_in6_addr *addr,
{
if (sortlist[i].family != AF_INET6)
continue;
- if (!ares_bitncmp(addr,
- &sortlist[i].addrV6,
- sortlist[i].mask.bits))
- break;
+ if (!ares__bitncmp(addr, &sortlist[i].addrV6, sortlist[i].mask.bits))
+ break;
}
return i;
}