diff options
author | Yu Jiung <jiung.yu@samsung.com> | 2016-11-09 11:15:33 +0900 |
---|---|---|
committer | Yu Jiung <jiung.yu@samsung.com> | 2016-11-09 11:15:43 +0900 |
commit | b6627e2c19506bd30328969ea8aab73fa0945f36 (patch) | |
tree | 24b768763efadd60f318873601e58dd98fe9714c /ares_gethostbyname.c | |
parent | b8e6c26b7b9608dffc84645f17fe4cf534af18dd (diff) | |
download | c-ares-b6627e2c19506bd30328969ea8aab73fa0945f36.tar.gz c-ares-b6627e2c19506bd30328969ea8aab73fa0945f36.tar.bz2 c-ares-b6627e2c19506bd30328969ea8aab73fa0945f36.zip |
Imported Upstream version 1.10.0
Change-Id: Ic7f3b0ad7dca62abe4cfa642a5eb5e190eb7a8c9
Diffstat (limited to 'ares_gethostbyname.c')
-rw-r--r-- | ares_gethostbyname.c | 24 |
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; } |