Commit 1f0ce3ab authored by Jason Madden's avatar Jason Madden

Update c-ares to 1.16, and all bundled config.*

Fixes #1588 and fixes #1589
parent a342b82c
......@@ -53,11 +53,6 @@ Updating c-ares
At this point there might be new files in libuv that need added to
git, evaluate them and add them.
- Evaluate whether the release has
https://github.com/c-ares/c-ares/issues/246 fixed. If not, ``git
apply cares-win32.patch``. If so, then delete that file and this
part of the instructions.
- Follow the same 'config.guess' and 'config.sub' steps as libev.
......
This diff is collapsed.
......@@ -69,7 +69,7 @@ DIST_SUBDIRS = test
pkgconfigdir = $(libdir)/pkgconfig
pkgconfig_DATA = libcares.pc
CARES_VERSION_INFO = -version-info 5:0:3
CARES_VERSION_INFO = -version-info 6:0:4
# This flag accepts an argument of the form current[:revision[:age]]. So,
# passing -version-info 3:12:1 sets current to 3, revision to 12, and age to
# 1.
......
This diff is collapsed.
CSOURCES = ares__close_sockets.c \
ares__get_hostent.c \
ares__parse_into_addrinfo.c \
ares__readaddrinfo.c \
ares__sortaddrinfo.c \
ares__read_line.c \
ares__timeval.c \
ares_android.c \
......@@ -12,6 +15,8 @@ CSOURCES = ares__close_sockets.c \
ares_fds.c \
ares_free_hostent.c \
ares_free_string.c \
ares_freeaddrinfo.c \
ares_getaddrinfo.c \
ares_getenv.c \
ares_gethostbyaddr.c \
ares_gethostbyname.c \
......@@ -88,8 +93,10 @@ HTMLPAGES = ares_cancel.html \
ares_free_data.html \
ares_free_hostent.html \
ares_free_string.html \
ares_freeaddrinfo.html \
ares_get_servers.html \
ares_get_servers_ports.html \
ares_getaddrinfo.html \
ares_gethostbyaddr.html \
ares_gethostbyname.html \
ares_gethostbyname_file.html \
......@@ -143,8 +150,10 @@ PDFPAGES = ares_cancel.pdf \
ares_free_data.pdf \
ares_free_hostent.pdf \
ares_free_string.pdf \
ares_freeaddrinfo.pdf \
ares_get_servers.pdf \
ares_get_servers_ports.pdf \
ares_getaddrinfo.pdf \
ares_gethostbyaddr.pdf \
ares_gethostbyname.pdf \
ares_gethostbyname_file.pdf \
......
......@@ -364,10 +364,10 @@ PROG3_OBJS = $(PROG3_OBJS) $(PROG3_OBJDIR)\ahost.obj
!IF "$(VALID_CFGSET)" == "FALSE"
ALL:
$(MAKE) /f .\Makefile.msvc CFG=lib-release ALL
$(MAKE) /f .\Makefile.msvc CFG=lib-debug ALL
$(MAKE) /f .\Makefile.msvc CFG=dll-release ALL
$(MAKE) /f .\Makefile.msvc CFG=dll-debug ALL
$(MAKE) /NOLOGO /f .\Makefile.msvc CFG=lib-release ALL
$(MAKE) /NOLOGO /f .\Makefile.msvc CFG=lib-debug ALL
$(MAKE) /NOLOGO /f .\Makefile.msvc CFG=dll-release ALL
$(MAKE) /NOLOGO /f .\Makefile.msvc CFG=dll-debug ALL
clean:
@-RMDIR /S /Q $(BASE_DIR) >NUL 2>&1
......
......@@ -2,9 +2,10 @@ c-ares
======
[![Build Status](https://travis-ci.org/c-ares/c-ares.svg?branch=master)](https://travis-ci.org/c-ares/c-ares)
[![Windows Build Status](https://ci.appveyor.com/api/projects/status/03i7151772eq3wn3/branch/master?svg=true)](https://ci.appveyor.com/project/c-ares/c-ares)
[![Windows Build Status](https://ci.appveyor.com/api/projects/status/aevgc5914tm72pvs/branch/master?svg=true)](https://ci.appveyor.com/project/c-ares/c-ares/branch/master)
[![Coverage Status](https://coveralls.io/repos/c-ares/c-ares/badge.svg?branch=master&service=github)](https://coveralls.io/github/c-ares/c-ares?branch=master)
[![CII Best Practices](https://bestpractices.coreinfrastructure.org/projects/291/badge)](https://bestpractices.coreinfrastructure.org/projects/291)
[![Fuzzing Status](https://oss-fuzz-build-logs.storage.googleapis.com/badges/c-ares.svg)](https://bugs.chromium.org/p/oss-fuzz/issues/list?sort=-opened&can=1&q=proj:c-ares)
[![Releases](https://coderelease.io/badge/c-ares/c-ares)](https://coderelease.io/github/repository/c-ares/c-ares)
This is c-ares, an asynchronous resolver library. It is intended for
......
c-ares version 1.15.0
c-ares version 1.16.0
Changes:
o Add ares_init_options() configurability for path to resolv.conf file [1]
o Ability to exclude building of tools (adig, ahost, acountry) in CMake [3]
o Android: Support for domain search suffix [4]
o Report ARES_ENOTFOUND for .onion domain names as per RFC7686. [13]
o Introduction of ares_getaddrinfo() API which provides similar output
(including proper sorting as per RFC 6724) to the system native API, but
utilizes different data structures in order to provide additional information
such as TTLs and all aliases. Please reference the respective man pages for
usage details. [3] [4] [5] [7] [8] [13] [14] [15] [16] [17] [22]
o Parse SOA records from ns_t_any response [29] [30]
o CMake: Provide c-ares version in package export file [24]
o CMake: Add CPACK functionality for DEB and RPM [28]
o CMake: Generate PDB files during build [33] [34]
o CMake: Support manpage installation [37] [38]
Bug fixes:
o AIX build fix for trying to include both nameser_compat.h and
onameser_compat.h [2]
o Windows: Improve DNS suffixes extracting from WinNT registry [5]
o Fix modern GCC warnings [6]
o Apply the IPv6 server blacklist to all nameserver sources, not just Windows
[7]
o Fix warnings emitted by MSVC when using -W4 [8]
o Prevent changing name servers while queries are outstanding [9]
o Harden and rationalize c-ares timeout computation [10]
o Distribute ares_android.h [11]
o ares_set_servers_csv() on failure should not leave channel in a bad state
[12]
o Add missing docs to distribution
o Fix bad expectation in IPv6 localhost test. [1] [2]
o AutoTools: use XC_CHECK_BUILD_FLAGS instead of XC_CHECK_USER_FLAGS to prevent
complaints about CPPFLAGS in CFLAGS. [6]
o Fix .onion handling
o Command line usage was out of date for adig and ahost. [18]
o Typos in manpages [19] [20]
o If ares_getenv is defined, it must return a value on all platforms [21]
o If /etc/resolv.conf has invalid lookup values, use the defaults. [23]
o Tests: Separate live tests from SetServers* tests as only live tests should
require internet access. [25]
o ares_gethostbyname() should return ENODATA if no valid A or AAAA record is
found, but a CNAME was found. [26] [27]
o CMake: Rework library function checking to prevent unintended linking with
system libraries that aren't needed. [31] [32]
o Due to use of inet_addr() it was not possible to return 255.255.255.255 from
ares_gethostbyname(). [35] [36]
o CMake: Fix building of tests on Windows
Thanks go to these friendly people for their efforts and contributions:
@afalin, Andi Schnebinger, Ben Noordhuis, Brad House, Brad Spencer,
David Hotham, @flyingdutchman23, John Schember, Ruslan Baratov,
Sarat Addepalli, Tobias Nießen (11 contributors)
Abhishek Arya (@inferno-chromium), Adam Majer (@AdamMajer),
Andrew Selivanov (@ki11roy), Ben Noordhuis (@bnoordhuis),
Brad House (@bradh352), Christian Ammer (@ChristianAmmer), Dan Noé (@dnoe),
Daniel Stenberg (@bagder), Darrin Cullop (@dwcullop),
Dron Rathore (@DronRathore), Fabrice Fontaine (@ffontaine),
Gregor Jasny (@gjasny), @kedixa, Khaidi Chu (@XadillaX),
Kyle Edwards (@KyleFromKitware), @lifenjoiner, Michal Rostecki (@mrostecki),
Peter Eisentraut (@petere), Piotr Pietraszkiewicz (@ppietrasa),
Stephen Bryant (@bf-bryants), @tjwalton, Vy Nguyen (@oontvoo)
(22 contributors)
References to bug reports and discussions on issues:
[1] = https://github.com/c-ares/c-ares/issues/220
[2] = https://github.com/c-ares/c-ares/issues/224
[3] = https://github.com/c-ares/c-ares/issues/200
[4] = https://github.com/c-ares/c-ares/issues/207
[5] = https://github.com/c-ares/c-ares/pull/202
[6] = https://github.com/c-ares/c-ares/pull/201
[7] = https://github.com/c-ares/c-ares/pull/193
[8] = https://github.com/c-ares/c-ares/pull/192
[9] = https://github.com/c-ares/c-ares/pull/191
[1] = https://github.com/c-ares/c-ares/pull/227
[2] = https://github.com/c-ares/c-ares/issues/85
[3] = https://github.com/c-ares/c-ares/pull/112
[4] = https://github.com/c-ares/c-ares/pull/233
[5] = https://github.com/c-ares/c-ares/pull/234
[6] = https://github.com/c-ares/c-ares/pull/236
[7] = https://github.com/c-ares/c-ares/pull/235
[8] = https://github.com/c-ares/c-ares/pull/239
[9] = https://github.com/c-ares/c-ares/pull/241
[10] = https://github.com/c-ares/c-ares/pull/187
[11] = https://c-ares.haxx.se/mail/c-ares-archive-2018-04/0000.shtml
[12] = https://c-ares.haxx.se/mail/c-ares-archive-2018-03/0000.shtml
[13] = https://github.com/c-ares/c-ares/issues/196
[11] = https://github.com/c-ares/c-ares/pull/252
[12] = https://github.com/c-ares/c-ares/issues/251
[13] = https://github.com/c-ares/c-ares/pull/258
[14] = https://github.com/c-ares/c-ares/pull/257
[15] = https://github.com/c-ares/c-ares/pull/262
[16] = https://github.com/c-ares/c-ares/pull/264
[17] = https://github.com/c-ares/c-ares/pull/265
[18] = https://github.com/c-ares/c-ares/pull/256
[19] = https://github.com/c-ares/c-ares/pull/269
[20] = https://github.com/c-ares/c-ares/pull/275
[21] = https://github.com/c-ares/c-ares/pull/279
[22] = https://github.com/c-ares/c-ares/pull/290
[23] = https://github.com/c-ares/c-ares/pull/274
[24] = https://github.com/c-ares/c-ares/pull/296
[25] = https://github.com/c-ares/c-ares/pull/299
[26] = https://github.com/c-ares/c-ares/pull/304
[27] = https://github.com/c-ares/c-ares/issues/303
[28] = https://github.com/c-ares/c-ares/pull/283
[29] = https://github.com/c-ares/c-ares/pull/103
[30] = https://github.com/c-ares/c-ares/issues/102
[31] = https://github.com/c-ares/c-ares/pull/310
[32] = https://github.com/c-ares/c-ares/issues/307
[33] = https://github.com/c-ares/c-ares/pull/311
[34] = https://github.com/c-ares/c-ares/issues/245
[35] = https://github.com/c-ares/c-ares/issues/309
[36] = https://github.com/c-ares/c-ares/pull/312
[37] = https://github.com/c-ares/c-ares/issues/297
[38] = https://github.com/c-ares/c-ares/pull/314
......@@ -69,7 +69,7 @@
#define INADDR_NONE 0xffffffff
#endif
static const char *usage = "acountry [-vh?] {host|addr} ...\n";
static const char *usage = "acountry [-?hdv] {host|addr} ...\n";
static const char nerd_fmt[] = "%u.%u.%u.%u.zz.countries.nerd.dk";
static const char *nerd_ver1 = nerd_fmt + 14; /* .countries.nerd.dk */
static const char *nerd_ver2 = nerd_fmt + 11; /* .zz.countries.nerd.dk */
......
......@@ -795,8 +795,8 @@ static const char *class_name(int dnsclass)
static void usage(void)
{
fprintf(stderr, "usage: adig [-f flag] [-s server] [-c class] "
"[-t type] [-p port] name ...\n");
fprintf(stderr, "usage: adig [-h] [-d] [-f flag] [-s server] [-c class] "
"[-t type] [-T|U port] name ...\n");
exit(1);
}
......
......@@ -201,6 +201,6 @@ static void callback(void *arg, int status, int timeouts, struct hostent *host)
static void usage(void)
{
fprintf(stderr, "usage: ahost [-t {a|aaaa|u}] {host|addr} ...\n");
fprintf(stderr, "usage: ahost [-h] [-d] [-s {domain}] [-t {a|aaaa|u}] {host|addr} ...\n");
exit(1);
}
......@@ -135,6 +135,9 @@ extern "C" {
/* More error codes */
#define ARES_ECANCELLED 24 /* introduced in 1.7.0 */
/* More ares_getaddrinfo error codes */
#define ARES_ESERVICE 25 /* introduced in 1.?.0 */
/* Flag values */
#define ARES_FLAG_USEVC (1 << 0)
#define ARES_FLAG_PRIMARY (1 << 1)
......@@ -192,6 +195,8 @@ extern "C" {
#define ARES_AI_V4MAPPED (1 << 4)
#define ARES_AI_ALL (1 << 5)
#define ARES_AI_ADDRCONFIG (1 << 6)
#define ARES_AI_NOSORT (1 << 7)
#define ARES_AI_ENVHOSTS (1 << 8)
/* Reserved for future use */
#define ARES_AI_IDN (1 << 10)
#define ARES_AI_IDN_ALLOW_UNASSIGNED (1 << 11)
......@@ -278,6 +283,8 @@ struct hostent;
struct timeval;
struct sockaddr;
struct ares_channeldata;
struct ares_addrinfo;
struct ares_addrinfo_hints;
typedef struct ares_channeldata *ares_channel;
......@@ -306,6 +313,11 @@ typedef int (*ares_sock_config_callback)(ares_socket_t socket_fd,
int type,
void *data);
typedef void (*ares_addrinfo_callback)(void *arg,
int status,
int timeouts,
struct ares_addrinfo *res);
CARES_EXTERN int ares_library_init(int flags);
CARES_EXTERN int ares_library_init_mem(int flags,
......@@ -369,6 +381,15 @@ CARES_EXTERN void ares_set_socket_configure_callback(ares_channel channel,
CARES_EXTERN int ares_set_sortlist(ares_channel channel,
const char *sortstr);
CARES_EXTERN void ares_getaddrinfo(ares_channel channel,
const char* node,
const char* service,
const struct ares_addrinfo_hints* hints,
ares_addrinfo_callback callback,
void* arg);
CARES_EXTERN void ares_freeaddrinfo(struct ares_addrinfo* ai);
/*
* Virtual function set to have user-managed socket IO.
* Note that all functions need to be defined, and when
......@@ -558,6 +579,44 @@ struct ares_soa_reply {
unsigned int minttl;
};
/*
* Similar to addrinfo, but with extra ttl and missing canonname.
*/
struct ares_addrinfo_node {
int ai_ttl;
int ai_flags;
int ai_family;
int ai_socktype;
int ai_protocol;
ares_socklen_t ai_addrlen;
struct sockaddr *ai_addr;
struct ares_addrinfo_node *ai_next;
};
/*
* alias - label of the resource record.
* name - value (canonical name) of the resource record.
* See RFC2181 10.1.1. CNAME terminology.
*/
struct ares_addrinfo_cname {
int ttl;
char *alias;
char *name;
struct ares_addrinfo_cname *next;
};
struct ares_addrinfo {
struct ares_addrinfo_cname *cnames;
struct ares_addrinfo_node *nodes;
};
struct ares_addrinfo_hints {
int ai_flags;
int ai_family;
int ai_socktype;
int ai_protocol;
};
/*
** Parse the buffer, starting at *abuf and of length alen bytes, previously
** obtained from an ares_search call. Put the results in *host, if nonnull.
......
......@@ -48,14 +48,14 @@ void ares__close_sockets(ares_channel channel, struct server_state *server)
if (server->tcp_socket != ARES_SOCKET_BAD)
{
SOCK_STATE_CALLBACK(channel, server->tcp_socket, 0, 0);
ares__socket_close(channel, server->tcp_socket);
ares__close_socket(channel, server->tcp_socket);
server->tcp_socket = ARES_SOCKET_BAD;
server->tcp_connection_generation = ++channel->tcp_connection_generation;
}
if (server->udp_socket != ARES_SOCKET_BAD)
{
SOCK_STATE_CALLBACK(channel, server->udp_socket, 0, 0);
ares__socket_close(channel, server->udp_socket);
ares__close_socket(channel, server->udp_socket);
server->udp_socket = ARES_SOCKET_BAD;
}
}
......@@ -138,8 +138,7 @@ int ares__get_hostent(FILE *fp, int family, struct hostent **host)
addr.addrV4.s_addr = INADDR_NONE;
if ((family == AF_INET) || (family == AF_UNSPEC))
{
addr.addrV4.s_addr = inet_addr(txtaddr);
if (addr.addrV4.s_addr != INADDR_NONE)
if (ares_inet_pton(AF_INET, txtaddr, &addr.addrV4) > 0)
{
/* Actual network address family and length. */
addr.family = AF_INET;
......
/* Copyright (C) 2019 by Andrew Selivanov
*
* Permission to use, copy, modify, and distribute this
* software and its documentation for any purpose and without
* fee is hereby granted, provided that the above copyright
* notice appear in all copies and that both that copyright
* notice and this permission notice appear in supporting
* documentation, and that the name of M.I.T. not be used in
* advertising or publicity pertaining to distribution of the
* software without specific, written prior permission.
* M.I.T. makes no representations about the suitability of
* this software for any purpose. It is provided "as is"
* without express or implied warranty.
*/
#include "ares_setup.h"
#ifdef HAVE_NETINET_IN_H
# include <netinet/in.h>
#endif
#ifdef HAVE_NETDB_H
# include <netdb.h>
#endif
#ifdef HAVE_ARPA_INET_H
# include <arpa/inet.h>
#endif
#ifdef HAVE_ARPA_NAMESER_H
# include <arpa/nameser.h>
#else
# include "nameser.h"
#endif
#ifdef HAVE_ARPA_NAMESER_COMPAT_H
# include <arpa/nameser_compat.h>
#endif
#ifdef HAVE_STRINGS_H
# include <strings.h>
#endif
#ifdef HAVE_LIMITS_H
# include <limits.h>
#endif
#include "ares.h"
#include "ares_dns.h"
#include "ares_private.h"
int ares__parse_into_addrinfo2(const unsigned char *abuf,
int alen,
char **question_hostname,
struct ares_addrinfo *ai)
{
unsigned int qdcount, ancount;
int status, i, rr_type, rr_class, rr_len, rr_ttl;
int got_a = 0, got_aaaa = 0, got_cname = 0;
long len;
const unsigned char *aptr;
char *hostname, *rr_name = NULL, *rr_data;
struct ares_addrinfo_cname *cname, *cnames = NULL;
struct ares_addrinfo_node *node, *nodes = NULL;
struct sockaddr_in *sin;
struct sockaddr_in6 *sin6;
*question_hostname = NULL;
/* Give up if abuf doesn't have room for a header. */
if (alen < HFIXEDSZ)
return ARES_EBADRESP;
/* Fetch the question and answer count from the header. */
qdcount = DNS_HEADER_QDCOUNT(abuf);
ancount = DNS_HEADER_ANCOUNT(abuf);
if (qdcount != 1)
return ARES_EBADRESP;
/* Expand the name from the question, and skip past the question. */
aptr = abuf + HFIXEDSZ;
status = ares__expand_name_for_response(aptr, abuf, alen, question_hostname, &len);
if (status != ARES_SUCCESS)
return status;
if (aptr + len + QFIXEDSZ > abuf + alen)
{
return ARES_EBADRESP;
}
hostname = *question_hostname;
aptr += len + QFIXEDSZ;
/* Examine each answer resource record (RR) in turn. */
for (i = 0; i < (int)ancount; i++)
{
/* Decode the RR up to the data field. */
status = ares__expand_name_for_response(aptr, abuf, alen, &rr_name, &len);
if (status != ARES_SUCCESS)
{
rr_name = NULL;
goto failed_stat;
}
aptr += len;
if (aptr + RRFIXEDSZ > abuf + alen)
{
status = ARES_EBADRESP;
goto failed_stat;
}
rr_type = DNS_RR_TYPE(aptr);
rr_class = DNS_RR_CLASS(aptr);
rr_len = DNS_RR_LEN(aptr);
rr_ttl = DNS_RR_TTL(aptr);
aptr += RRFIXEDSZ;
if (aptr + rr_len > abuf + alen)
{
status = ARES_EBADRESP;
goto failed_stat;
}
if (rr_class == C_IN && rr_type == T_A
&& rr_len == sizeof(struct in_addr)
&& strcasecmp(rr_name, hostname) == 0)
{
got_a = 1;
if (aptr + sizeof(struct in_addr) > abuf + alen)
{ /* LCOV_EXCL_START: already checked above */
status = ARES_EBADRESP;
goto failed_stat;
} /* LCOV_EXCL_STOP */
node = ares__append_addrinfo_node(&nodes);
if (!node)
{
status = ARES_ENOMEM;
goto failed_stat;
}
sin = ares_malloc(sizeof(struct sockaddr_in));
if (!sin)
{
status = ARES_ENOMEM;
goto failed_stat;
}
memset(sin, 0, sizeof(struct sockaddr_in));
memcpy(&sin->sin_addr.s_addr, aptr, sizeof(struct in_addr));
sin->sin_family = AF_INET;
node->ai_addr = (struct sockaddr *)sin;
node->ai_family = AF_INET;
node->ai_addrlen = sizeof(struct sockaddr_in);
node->ai_ttl = rr_ttl;
status = ARES_SUCCESS;
}
else if (rr_class == C_IN && rr_type == T_AAAA
&& rr_len == sizeof(struct ares_in6_addr)
&& strcasecmp(rr_name, hostname) == 0)
{
got_aaaa = 1;
if (aptr + sizeof(struct ares_in6_addr) > abuf + alen)
{ /* LCOV_EXCL_START: already checked above */
status = ARES_EBADRESP;
goto failed_stat;
} /* LCOV_EXCL_STOP */
node = ares__append_addrinfo_node(&nodes);
if (!node)
{
status = ARES_ENOMEM;
goto failed_stat;
}
sin6 = ares_malloc(sizeof(struct sockaddr_in6));
if (!sin6)
{
status = ARES_ENOMEM;
goto failed_stat;
}
memset(sin6, 0, sizeof(struct sockaddr_in6));
memcpy(&sin6->sin6_addr.s6_addr, aptr, sizeof(struct ares_in6_addr));
sin6->sin6_family = AF_INET6;
node->ai_addr = (struct sockaddr *)sin6;
node->ai_family = AF_INET6;
node->ai_addrlen = sizeof(struct sockaddr_in6);
node->ai_ttl = rr_ttl;
status = ARES_SUCCESS;
}
if (rr_class == C_IN && rr_type == T_CNAME)
{
got_cname = 1;
status = ares__expand_name_for_response(aptr, abuf, alen, &rr_data,
&len);
if (status != ARES_SUCCESS)
{
goto failed_stat;
}
/* Decode the RR data and replace the hostname with it. */
/* SA: Seems wrong as it introduses order dependency. */
hostname = rr_data;
cname = ares__append_addrinfo_cname(&cnames);
if (!cname)
{
status = ARES_ENOMEM;
ares_free(rr_data);
goto failed_stat;
}
cname->ttl = rr_ttl;
cname->alias = rr_name;
cname->name = rr_data;
}
else
{
ares_free(rr_name);
}
aptr += rr_len;
if (aptr > abuf + alen)
{ /* LCOV_EXCL_START: already checked above */
status = ARES_EBADRESP;
goto failed_stat;
} /* LCOV_EXCL_STOP */
}
if (status == ARES_SUCCESS)
{
ares__addrinfo_cat_nodes(&ai->nodes, nodes);
if (got_cname)
{
ares__addrinfo_cat_cnames(&ai->cnames, cnames);
return status;
}
else if (got_a == 0 && got_aaaa == 0)
{
/* the check for naliases to be zero is to make sure CNAME responses
don't get caught here */
status = ARES_ENODATA;
}
}
return status;
failed_stat:
ares_free(rr_name);
ares__freeaddrinfo_cnames(cnames);
ares__freeaddrinfo_nodes(nodes);
return status;
}
int ares__parse_into_addrinfo(const unsigned char *abuf,
int alen,
struct ares_addrinfo *ai)
{
int status;
char *question_hostname;
status = ares__parse_into_addrinfo2(abuf, alen, &question_hostname, ai);
ares_free(question_hostname);
return status;
}
/* Copyright (C) 2019 by Andrew Selivanov
*
* Permission to use, copy, modify, and distribute this
* software and its documentation for any purpose and without
* fee is hereby granted, provided that the above copyright
* notice appear in all copies and that both that copyright
* notice and this permission notice appear in supporting
* documentation, and that the name of M.I.T. not be used in
* advertising or publicity pertaining to distribution of the
* software without specific, written prior permission.
* M.I.T. makes no representations about the suitability of
* this software for any purpose. It is provided "as is"
* without express or implied warranty.
*/
#include "ares_setup.h"
#ifdef HAVE_NETINET_IN_H
# include <netinet/in.h>
#endif
#ifdef HAVE_NETDB_H
# include <netdb.h>
#endif
#ifdef HAVE_ARPA_INET_H
# include <arpa/inet.h>
#endif
#include "ares.h"
#include "ares_inet_net_pton.h"
#include "ares_nowarn.h"
#include "ares_private.h"
#define MAX_ALIASES 40
int ares__readaddrinfo(FILE *fp,
const char *name,
unsigned short port,
const struct ares_addrinfo_hints *hints,
struct ares_addrinfo *ai)
{
char *line = NULL, *p, *q;
char *txtaddr, *txthost, *txtalias;
char *aliases[MAX_ALIASES];
unsigned int i, alias_count;
int status;
size_t linesize;
ares_sockaddr addr;
struct ares_addrinfo_cname *cname = NULL, *cnames = NULL;
struct ares_addrinfo_node *node = NULL, *nodes = NULL;
int match_with_alias, match_with_canonical;
int want_cname = hints->ai_flags & ARES_AI_CANONNAME;
/* Validate family */
switch (hints->ai_family) {
case AF_INET:
case AF_INET6:
case AF_UNSPEC:
break;
default:
return ARES_EBADFAMILY;
}
while ((status = ares__read_line(fp, &line, &linesize)) == ARES_SUCCESS)
{
match_with_alias = 0;
match_with_canonical = 0;
alias_count = 0;
/* Trim line comment. */
p = line;
while (*p && (*p != '#'))
p++;
*p = '\0';
/* Trim trailing whitespace. */
q = p - 1;
while ((q >= line) && ISSPACE(*q))
q--;
*++q = '\0';
/* Skip leading whitespace. */
p = line;
while (*p && ISSPACE(*p))
p++;
if (!*p)
/* Ignore line if empty. */
continue;
/* Pointer to start of IPv4 or IPv6 address part. */
txtaddr = p;
/* Advance past address part. */
while (*p && !ISSPACE(*p))
p++;
if (!*p)
/* Ignore line if reached end of line. */
continue;
/* Null terminate address part. */
*p = '\0';
/* Advance to host name */
p++;
while (*p && ISSPACE(*p))
p++;
if (!*p)
/* Ignore line if reached end of line. */
continue; /* LCOV_EXCL_LINE: trailing whitespace already stripped */
/* Pointer to start of host name. */
txthost = p;
/* Advance past host name. */
while (*p && !ISSPACE(*p))
p++;
/* Pointer to start of first alias. */
txtalias = NULL;
if (*p)
{
q = p + 1;
while (*q && ISSPACE(*q))
q++;
if (*q)
txtalias = q;
}
/* Null terminate host name. */
*p = '\0';
/* Find out if host name matches with canonical host name. */
if (strcasecmp(txthost, name) == 0)
{
match_with_canonical = 1;
}
/* Find out if host name matches with one of the aliases. */
while (txtalias)
{
p = txtalias;
while (*p && !ISSPACE(*p))
p++;
q = p;
while (*q && ISSPACE(*q))
q++;
*p = '\0';
if (strcasecmp(txtalias, name) == 0)
{
match_with_alias = 1;
if (!want_cname)
break;
}
if (alias_count < MAX_ALIASES)
{
aliases[alias_count++] = txtalias;
}
txtalias = *q ? q : NULL;
}
/* Try next line if host does not match. */
if (!match_with_alias && !match_with_canonical)
{
continue;
}
/*
* Convert address string to network address for the requested families.
* Actual address family possible values are AF_INET and AF_INET6 only.
*/
if ((hints->ai_family == AF_INET) || (hints->ai_family == AF_UNSPEC))
{
addr.sa4.sin_port = htons(port);
if (ares_inet_pton(AF_INET, txtaddr, &addr.sa4.sin_addr) > 0)
{
node = ares__append_addrinfo_node(&nodes);
if(!node)
{
goto enomem;
}
node->ai_family = addr.sa.sa_family = AF_INET;
node->ai_addrlen = sizeof(sizeof(addr.sa4));
node->ai_addr = ares_malloc(sizeof(addr.sa4));
if (!node->ai_addr)
{
goto enomem;
}
memcpy(node->ai_addr, &addr.sa4, sizeof(addr.sa4));
}
}
if ((hints->ai_family == AF_INET6) || (hints->ai_family == AF_UNSPEC))
{
addr.sa6.sin6_port = htons(port);
if (ares_inet_pton(AF_INET6, txtaddr, &addr.sa6.sin6_addr) > 0)
{
node = ares__append_addrinfo_node(&nodes);
if (!node)
{
goto enomem;
}
node->ai_family = addr.sa.sa_family = AF_INET6;
node->ai_addrlen = sizeof(sizeof(addr.sa6));
node->ai_addr = ares_malloc(sizeof(addr.sa6));
if (!node->ai_addr)
{
goto enomem;
}
memcpy(node->ai_addr, &addr.sa6, sizeof(addr.sa6));
}
}
if (!node)
/* Ignore line if invalid address string for the requested family. */
continue;
if (want_cname)
{
for (i = 0; i < alias_count; ++i)
{
cname = ares__append_addrinfo_cname(&cnames);
if (!cname)
{
goto enomem;
}
cname->alias = ares_strdup(aliases[i]);
cname->name = ares_strdup(txthost);
}
/* No aliases, cname only. */
if(!alias_count)
{
cname = ares__append_addrinfo_cname(&cnames);
if (!cname)
{
goto enomem;
}
cname->name = ares_strdup(txthost);
}
}
}
/* Last read failed. */
if (status == ARES_ENOMEM)
{
goto enomem;
}
/* Free line buffer. */
ares_free(line);
ares__addrinfo_cat_cnames(&ai->cnames, cnames);
ares__addrinfo_cat_nodes(&ai->nodes, nodes);
return node ? ARES_SUCCESS : ARES_ENOTFOUND;
enomem:
ares_free(line);
ares__freeaddrinfo_cnames(cnames);
ares__freeaddrinfo_nodes(nodes);
return ARES_ENOMEM;
}
This diff is collapsed.
......@@ -360,8 +360,6 @@ char *ares_get_android_search_domains_list(void)
jstring domains = NULL;
const char *domain;
int res;
size_t i;
size_t cnt = 0;
char *domain_list = NULL;
int need_detatch = 0;
......
......@@ -94,14 +94,14 @@ int ares_create_query(const char *name, int dnsclass, int type,
size_t buflen;
unsigned char *buf;
/* Per RFC 7686, reject queries for ".onion" domain names with NXDOMAIN. */
if (ares__is_onion_domain(name))
return ARES_ENOTFOUND;
/* Set our results early, in case we bail out early with an error. */
*buflenp = 0;
*bufp = NULL;
/* Per RFC 7686, reject queries for ".onion" domain names with NXDOMAIN. */
if (ares__is_onion_domain(name))
return ARES_ENOTFOUND;
/* Allocate a memory area for the maximum size this packet might need. +2
* is for the length byte and zero termination if no dots or ecscaping is
* used.
......
/* Copyright 1998 by the Massachusetts Institute of Technology.
* Copyright (C) 2019 by Andrew Selivanov
*
* Permission to use, copy, modify, and distribute this
* software and its documentation for any purpose and without
* fee is hereby granted, provided that the above copyright
* notice appear in all copies and that both that copyright
* notice and this permission notice appear in supporting
* documentation, and that the name of M.I.T. not be used in
* advertising or publicity pertaining to distribution of the
* software without specific, written prior permission.
* M.I.T. makes no representations about the suitability of
* this software for any purpose. It is provided "as is"
* without express or implied warranty.
*/
#include "ares_setup.h"
#ifdef HAVE_NETDB_H
# include <netdb.h>
#endif
#include "ares.h"
#include "ares_private.h"
void ares__freeaddrinfo_cnames(struct ares_addrinfo_cname *head)
{
struct ares_addrinfo_cname *current;
while (head)
{
current = head;
head = head->next;
ares_free(current->alias);
ares_free(current->name);
ares_free(current);
}
}
void ares__freeaddrinfo_nodes(struct ares_addrinfo_node *head)
{
struct ares_addrinfo_node *current;
while (head)
{
current = head;
head = head->ai_next;
ares_free(current->ai_addr);
ares_free(current);
}
}
void ares_freeaddrinfo(struct ares_addrinfo *ai)
{
ares__freeaddrinfo_cnames(ai->cnames);
ares__freeaddrinfo_nodes(ai->nodes);
ares_free(ai);
}
This diff is collapsed.
......@@ -22,9 +22,7 @@
char *ares_getenv(const char *name)
{
#ifdef _WIN32_WCE
return NULL;
#endif
}
#endif
......@@ -211,6 +211,13 @@ static void host_callback(void *arg, int status, int timeouts,
if (host && channel->nsort)
sort6_addresses(host, channel->sortlist, channel->nsort);
}
if (status == ARES_SUCCESS && host && host->h_addr_list[0] == NULL)
{
/* The query returned something but had no A/AAAA record
(even after potentially retrying AAAA with A)
so we should treat this as an error */
status = ARES_ENODATA;
}
end_hquery(hquery, status, host);
}
else if ((status == ARES_ENODATA || status == ARES_EBADRESP ||
......@@ -267,12 +274,12 @@ static int fake_hostent(const char *name, int family,
}
/* if we don't have 3 dots, it is illegal
* (although inet_addr doesn't think so).
* (although inet_pton doesn't think so).
*/
if (numdots != 3 || !valid)
result = 0;
else
result = ((in.s_addr = inet_addr(name)) == INADDR_NONE ? 0 : 1);
result = (ares_inet_pton(AF_INET, name, &in) < 1 ? 0 : 1);
if (result)
family = AF_INET;
......@@ -387,6 +394,7 @@ static int file_lookup(const char *name, int family, struct hostent **host)
if (ares__is_onion_domain(name))
return ARES_ENOTFOUND;
fp = fopen(PATH_HOSTS, "r");
if (!fp)
{
......
......@@ -1543,8 +1543,6 @@ static int init_by_resolv_conf(ares_channel channel)
#elif defined(ANDROID) || defined(__ANDROID__)
unsigned int i;
char propname[PROP_NAME_MAX];
char propvalue[PROP_VALUE_MAX]="";
char **dns_servers;
char *domains;
size_t num_servers;
......@@ -1587,6 +1585,8 @@ static int init_by_resolv_conf(ares_channel channel)
* We'll only run this if we don't have any dns servers
* because this will get the same ones (if it works). */
if (status != ARES_EOF) {
char propname[PROP_NAME_MAX];
char propvalue[PROP_VALUE_MAX]="";
for (i = 1; i <= MAX_DNS_PROPERTIES; i++) {
snprintf(propname, sizeof(propname), "%s%u", DNS_PROP_NAME_PREFIX, i);
if (__system_property_get(propname, propvalue) < 1) {
......@@ -2024,6 +2024,7 @@ static int config_lookup(ares_channel channel, const char *str,
{
char lookups[3], *l;
const char *vqualifier p;
int found;
if (altbindch == NULL)
altbindch = bindch;
......@@ -2034,17 +2035,21 @@ static int config_lookup(ares_channel channel, const char *str,
*/
l = lookups;
p = str;
found = 0;
while (*p)
{
if ((*p == *bindch || *p == *altbindch || *p == *filech) && l < lookups + 2) {
if (*p == *bindch || *p == *altbindch) *l++ = 'b';
else *l++ = 'f';
found = 1;
}
while (*p && !ISSPACE(*p) && (*p != ','))
p++;
while (*p && (ISSPACE(*p) || (*p == ',')))
p++;
}
if (!found)
return ARES_ENOTINITIALIZED;
*l = '\0';
channel->lookups = ares_strdup(lookups);
return (channel->lookups) ? ARES_SUCCESS : ARES_ENOMEM;
......@@ -2292,7 +2297,7 @@ static int set_search(ares_channel channel, const char *str)
channel->ndomains = -1;
} /* LCOV_EXCL_STOP */
channel->domains = ares_strsplit(str, ", ", 1, &cnt);
channel->domains = ares_strsplit(str, ", ", 1, &cnt);
channel->ndomains = (int)cnt;
if (channel->domains == NULL || channel->ndomains == 0) {
channel->domains = NULL;
......@@ -2418,9 +2423,9 @@ static int ip_addr(const char *ipbuf, ares_ssize_t len, struct in_addr *addr)
if (len > 15)
return -1;
addr->s_addr = inet_addr(ipbuf);
if (addr->s_addr == INADDR_NONE && strcmp(ipbuf, "255.255.255.255") != 0)
if (ares_inet_pton(AF_INET, ipbuf, addr) < 1)
return -1;
return 0;
}
......
......@@ -32,6 +32,13 @@ struct sockaddr_in6
};
#endif
typedef union
{
struct sockaddr sa;
struct sockaddr_in sa4;
struct sockaddr_in6 sa6;
} ares_sockaddr;
#ifndef HAVE_STRUCT_ADDRINFO
struct addrinfo
{
......
This diff is collapsed.
This diff is collapsed.
......@@ -48,8 +48,8 @@ ares_parse_soa_reply(const unsigned char *abuf, int alen,
long len;
char *qname = NULL, *rr_name = NULL;
struct ares_soa_reply *soa = NULL;
int qdcount, ancount;
int status;
int qdcount, ancount, qclass;
int status, i, rr_type, rr_class, rr_len;
if (alen < HFIXEDSZ)
return ARES_EBADRESP;
......@@ -57,8 +57,12 @@ ares_parse_soa_reply(const unsigned char *abuf, int alen,
/* parse message header */
qdcount = DNS_HEADER_QDCOUNT(abuf);
ancount = DNS_HEADER_ANCOUNT(abuf);
if (qdcount != 1 || ancount != 1)
if (qdcount != 1)
return ARES_EBADRESP;
if (ancount == 0)
return ARES_EBADRESP;
aptr = abuf + HFIXEDSZ;
/* query name */
......@@ -67,67 +71,112 @@ ares_parse_soa_reply(const unsigned char *abuf, int alen,
goto failed_stat;
aptr += len;
qclass = DNS_QUESTION_TYPE(aptr);
/* skip qtype & qclass */
if (aptr + QFIXEDSZ > abuf + alen)
goto failed;
aptr += QFIXEDSZ;
/* rr_name */
status = ares__expand_name_for_response(aptr, abuf, alen, &rr_name, &len);
if (status != ARES_SUCCESS)
goto failed_stat;
aptr += len;
/* skip rr_type, rr_class, rr_ttl, rr_rdlen */
if (aptr + RRFIXEDSZ > abuf + alen)
/* qclass of SOA with multiple answers */
if (qclass == T_SOA && ancount > 1)
goto failed;
aptr += RRFIXEDSZ;
/* allocate result struct */
soa = ares_malloc_data(ARES_DATATYPE_SOA_REPLY);
if (!soa)
/* examine all the records, break and return if found soa */
for (i = 0; i < ancount; i++)
{
rr_name = NULL;
status = ares__expand_name_for_response (aptr, abuf, alen, &rr_name, &len);
if (status != ARES_SUCCESS)
{
ares_free(rr_name);
goto failed_stat;
}
aptr += len;
if ( aptr + RRFIXEDSZ > abuf + alen )
{
status = ARES_ENOMEM;
ares_free(rr_name);
status = ARES_EBADRESP;
goto failed_stat;
}
/* nsname */
status = ares__expand_name_for_response(aptr, abuf, alen, &soa->nsname, &len);
if (status != ARES_SUCCESS)
goto failed_stat;
aptr += len;
/* hostmaster */
status = ares__expand_name_for_response(aptr, abuf, alen, &soa->hostmaster, &len);
if (status != ARES_SUCCESS)
goto failed_stat;
aptr += len;
/* integer fields */
if (aptr + 5 * 4 > abuf + alen)
goto failed;
soa->serial = DNS__32BIT(aptr + 0 * 4);
soa->refresh = DNS__32BIT(aptr + 1 * 4);
soa->retry = DNS__32BIT(aptr + 2 * 4);
soa->expire = DNS__32BIT(aptr + 3 * 4);
soa->minttl = DNS__32BIT(aptr + 4 * 4);
ares_free(qname);
ares_free(rr_name);
*soa_out = soa;
return ARES_SUCCESS;
rr_type = DNS_RR_TYPE( aptr );
rr_class = DNS_RR_CLASS( aptr );
rr_len = DNS_RR_LEN( aptr );
aptr += RRFIXEDSZ;
if (aptr + rr_len > abuf + alen)
{
ares_free(rr_name);
status = ARES_EBADRESP;
goto failed_stat;
}
if ( rr_class == C_IN && rr_type == T_SOA )
{
/* allocate result struct */
soa = ares_malloc_data(ARES_DATATYPE_SOA_REPLY);
if (!soa)
{
ares_free(rr_name);
status = ARES_ENOMEM;
goto failed_stat;
}
/* nsname */
status = ares__expand_name_for_response(aptr, abuf, alen, &soa->nsname,
&len);
if (status != ARES_SUCCESS)
{
ares_free(rr_name);
goto failed_stat;
}
aptr += len;
/* hostmaster */
status = ares__expand_name_for_response(aptr, abuf, alen,
&soa->hostmaster, &len);
if (status != ARES_SUCCESS)
{
ares_free(rr_name);
goto failed_stat;
}
aptr += len;
/* integer fields */
if (aptr + 5 * 4 > abuf + alen)
{
ares_free(rr_name);
goto failed;
}
soa->serial = DNS__32BIT(aptr + 0 * 4);
soa->refresh = DNS__32BIT(aptr + 1 * 4);
soa->retry = DNS__32BIT(aptr + 2 * 4);
soa->expire = DNS__32BIT(aptr + 3 * 4);
soa->minttl = DNS__32BIT(aptr + 4 * 4);
ares_free(qname);
ares_free(rr_name);
*soa_out = soa;
return ARES_SUCCESS;
}
aptr += rr_len;
ares_free(rr_name);
if (aptr > abuf + alen)
goto failed_stat;
}
/* no SOA record found */
status = ARES_EBADRESP;
goto failed_stat;
failed:
status = ARES_EBADRESP;
failed_stat:
ares_free_data(soa);
if (soa)
ares_free_data(soa);
if (qname)
ares_free(qname);
if (rr_name)
ares_free(rr_name);
return status;
}
......@@ -355,11 +355,51 @@ int ares__expand_name_for_response(const unsigned char *encoded,
char **s, long *enclen);
void ares__init_servers_state(ares_channel channel);
void ares__destroy_servers_state(ares_channel channel);
int ares__parse_qtype_reply(const unsigned char* abuf, int alen, int* qtype);
int ares__single_domain(ares_channel channel, const char *name, char **s);
int ares__cat_domain(const char *name, const char *domain, char **s);
int ares__sortaddrinfo(ares_channel channel, struct ares_addrinfo_node *ai_node);
int ares__readaddrinfo(FILE *fp, const char *name, unsigned short port,
const struct ares_addrinfo_hints *hints,
struct ares_addrinfo *ai);
struct ares_addrinfo *ares__malloc_addrinfo(void);
struct ares_addrinfo_node *ares__malloc_addrinfo_node(void);
void ares__freeaddrinfo_nodes(struct ares_addrinfo_node *ai_node);
struct ares_addrinfo_node *ares__append_addrinfo_node(struct ares_addrinfo_node **ai_node);
void ares__addrinfo_cat_nodes(struct ares_addrinfo_node **head,
struct ares_addrinfo_node *tail);
struct ares_addrinfo_cname *ares__malloc_addrinfo_cname(void);
void ares__freeaddrinfo_cnames(struct ares_addrinfo_cname *ai_cname);
struct ares_addrinfo_cname *ares__append_addrinfo_cname(struct ares_addrinfo_cname **ai_cname);
void ares__addrinfo_cat_cnames(struct ares_addrinfo_cname **head,
struct ares_addrinfo_cname *tail);
int ares__parse_into_addrinfo(const unsigned char *abuf,
int alen,
struct ares_addrinfo *ai);
int ares__parse_into_addrinfo2(const unsigned char *abuf,
int alen,
char **question_hostname,
struct ares_addrinfo *ai);
#if 0 /* Not used */
long ares__tvdiff(struct timeval t1, struct timeval t2);
#endif
void ares__socket_close(ares_channel, ares_socket_t);
ares_socket_t ares__open_socket(ares_channel channel,
int af, int type, int protocol);
void ares__close_socket(ares_channel, ares_socket_t);
int ares__connect_socket(ares_channel channel,
ares_socket_t sockfd,
const struct sockaddr *addr,
ares_socklen_t addrlen);
#define ARES_SWAP_BYTE(a,b) \
{ unsigned char swapByte = *(a); *(a) = *(b); *(b) = swapByte; }
......
......@@ -1039,30 +1039,6 @@ static int configure_socket(ares_socket_t s, int family, ares_channel channel)
return 0;
}
static ares_socket_t open_socket(ares_channel channel, int af, int type, int protocol)
{
if (channel->sock_funcs != 0)
return channel->sock_funcs->asocket(af,
type,
protocol,
channel->sock_func_cb_data);
return socket(af, type, protocol);
}
static int connect_socket(ares_channel channel, ares_socket_t sockfd,
const struct sockaddr * addr,
ares_socklen_t addrlen)
{
if (channel->sock_funcs != 0)
return channel->sock_funcs->aconnect(sockfd,
addr,
addrlen,
channel->sock_func_cb_data);
return connect(sockfd, addr, addrlen);
}
static int open_tcp_socket(ares_channel channel, struct server_state *server)
{
ares_socket_t s;
......@@ -1107,14 +1083,14 @@ static int open_tcp_socket(ares_channel channel, struct server_state *server)
}
/* Acquire a socket. */
s = open_socket(channel, server->addr.family, SOCK_STREAM, 0);
s = ares__open_socket(channel, server->addr.family, SOCK_STREAM, 0);
if (s == ARES_SOCKET_BAD)
return -1;
/* Configure it. */
if (configure_socket(s, server->addr.family, channel) < 0)
{
ares__socket_close(channel, s);
ares__close_socket(channel, s);
return -1;
}
......@@ -1131,7 +1107,7 @@ static int open_tcp_socket(ares_channel channel, struct server_state *server)
setsockopt(s, IPPROTO_TCP, TCP_NODELAY,
(void *)&opt, sizeof(opt)) == -1)
{
ares__socket_close(channel, s);
ares__close_socket(channel, s);
return -1;
}
#endif
......@@ -1142,19 +1118,19 @@ static int open_tcp_socket(ares_channel channel, struct server_state *server)
channel->sock_config_cb_data);
if (err < 0)
{
ares__socket_close(channel, s);
ares__close_socket(channel, s);
return err;
}
}
/* Connect to the server. */
if (connect_socket(channel, s, sa, salen) == -1)
if (ares__connect_socket(channel, s, sa, salen) == -1)
{
int err = SOCKERRNO;
if (err != EINPROGRESS && err != EWOULDBLOCK)
{
ares__socket_close(channel, s);
ares__close_socket(channel, s);
return -1;
}
}
......@@ -1165,7 +1141,7 @@ static int open_tcp_socket(ares_channel channel, struct server_state *server)
channel->sock_create_cb_data);
if (err < 0)
{
ares__socket_close(channel, s);
ares__close_socket(channel, s);
return err;
}
}
......@@ -1220,14 +1196,14 @@ static int open_udp_socket(ares_channel channel, struct server_state *server)
}
/* Acquire a socket. */
s = open_socket(channel, server->addr.family, SOCK_DGRAM, 0);
s = ares__open_socket(channel, server->addr.family, SOCK_DGRAM, 0);
if (s == ARES_SOCKET_BAD)
return -1;
/* Set the socket non-blocking. */
if (configure_socket(s, server->addr.family, channel) < 0)
{
ares__socket_close(channel, s);
ares__close_socket(channel, s);
return -1;
}
......@@ -1237,19 +1213,19 @@ static int open_udp_socket(ares_channel channel, struct server_state *server)
channel->sock_config_cb_data);
if (err < 0)
{
ares__socket_close(channel, s);
ares__close_socket(channel, s);
return err;
}
}
/* Connect to the server. */
if (connect_socket(channel, s, sa, salen) == -1)
if (ares__connect_socket(channel, s, sa, salen) == -1)
{
int err = SOCKERRNO;
if (err != EINPROGRESS && err != EWOULDBLOCK)
{
ares__socket_close(channel, s);
ares__close_socket(channel, s);
return -1;
}
}
......@@ -1260,7 +1236,7 @@ static int open_udp_socket(ares_channel channel, struct server_state *server)
channel->sock_create_cb_data);
if (err < 0)
{
ares__socket_close(channel, s);
ares__close_socket(channel, s);
return err;
}
}
......@@ -1464,7 +1440,33 @@ void ares__free_query(struct query *query)
ares_free(query);
}
void ares__socket_close(ares_channel channel, ares_socket_t s)
ares_socket_t ares__open_socket(ares_channel channel,
int af, int type, int protocol)
{
if (channel->sock_funcs)
return channel->sock_funcs->asocket(af,
type,
protocol,
channel->sock_func_cb_data);
else
return socket(af, type, protocol);
}
int ares__connect_socket(ares_channel channel,
ares_socket_t sockfd,
const struct sockaddr *addr,
ares_socklen_t addrlen)
{
if (channel->sock_funcs)
return channel->sock_funcs->aconnect(sockfd,
addr,
addrlen,
channel->sock_func_cb_data);
else
return connect(sockfd, addr, addrlen);
}
void ares__close_socket(ares_channel channel, ares_socket_t s)
{
if (channel->sock_funcs)
channel->sock_funcs->aclose(s, channel->sock_func_cb_data);
......
......@@ -43,8 +43,6 @@ static void search_callback(void *arg, int status, int timeouts,
unsigned char *abuf, int alen);
static void end_squery(struct search_query *squery, int status,
unsigned char *abuf, int alen);
static int cat_domain(const char *name, const char *domain, char **s);
STATIC_TESTABLE int single_domain(ares_channel channel, const char *name, char **s);
void ares_search(ares_channel channel, const char *name, int dnsclass,
int type, ares_callback callback, void *arg)
......@@ -64,7 +62,7 @@ void ares_search(ares_channel channel, const char *name, int dnsclass,
/* If name only yields one domain to search, then we don't have
* to keep extra state, so just do an ares_query().
*/
status = single_domain(channel, name, &s);
status = ares__single_domain(channel, name, &s);
if (status != ARES_SUCCESS)
{
callback(arg, status, 0, NULL, 0);
......@@ -126,7 +124,7 @@ void ares_search(ares_channel channel, const char *name, int dnsclass,
/* Try the name as-is last; start with the first search domain. */
squery->next_domain = 1;
squery->trying_as_is = 0;
status = cat_domain(name, channel->domains[0], &s);
status = ares__cat_domain(name, channel->domains[0], &s);
if (status == ARES_SUCCESS)
{
ares_query(channel, s, dnsclass, type, search_callback, squery);
......@@ -174,7 +172,7 @@ static void search_callback(void *arg, int status, int timeouts,
if (squery->next_domain < channel->ndomains)
{
/* Try the next domain. */
status = cat_domain(squery->name,
status = ares__cat_domain(squery->name,
channel->domains[squery->next_domain], &s);
if (status != ARES_SUCCESS)
end_squery(squery, status, NULL, 0);
......@@ -213,7 +211,7 @@ static void end_squery(struct search_query *squery, int status,
}
/* Concatenate two domains. */
static int cat_domain(const char *name, const char *domain, char **s)
int ares__cat_domain(const char *name, const char *domain, char **s)
{
size_t nlen = strlen(name);
size_t dlen = strlen(domain);
......@@ -232,7 +230,7 @@ static int cat_domain(const char *name, const char *domain, char **s)
* the string we should query, in an allocated buffer. If not, set *s
* to NULL.
*/
STATIC_TESTABLE int single_domain(ares_channel channel, const char *name, char **s)
int ares__single_domain(ares_channel channel, const char *name, char **s)
{
size_t len = strlen(name);
const char *hostaliases;
......
......@@ -3,15 +3,15 @@
#define ARES__VERSION_H
/* This is the global package copyright */
#define ARES_COPYRIGHT "2004 - 2017 Daniel Stenberg, <daniel@haxx.se>."
#define ARES_COPYRIGHT "2004 - 2020 Daniel Stenberg, <daniel@haxx.se>."
#define ARES_VERSION_MAJOR 1
#define ARES_VERSION_MINOR 15
#define ARES_VERSION_MINOR 16
#define ARES_VERSION_PATCH 0
#define ARES_VERSION ((ARES_VERSION_MAJOR<<16)|\
(ARES_VERSION_MINOR<<8)|\
(ARES_VERSION_PATCH))
#define ARES_VERSION_STR "1.15.0"
#define ARES_VERSION_STR "1.16.0"
#if (ARES_VERSION >= 0x010700)
# define CARES_HAVE_ARES_LIBRARY_INIT 1
......
#! /bin/sh
# Attempt to guess a canonical system name.
# Copyright 1992-2019 Free Software Foundation, Inc.
# Copyright 1992-2020 Free Software Foundation, Inc.
timestamp='2019-03-04'
timestamp='2020-04-26'
# This file is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by
......@@ -50,7 +50,7 @@ version="\
GNU config.guess ($timestamp)
Originally written by Per Bothner.
Copyright 1992-2019 Free Software Foundation, Inc.
Copyright 1992-2020 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
......@@ -99,6 +99,8 @@ tmp=
trap 'test -z "$tmp" || rm -fr "$tmp"' 0 1 2 13 15
set_cc_for_build() {
# prevent multiple calls if $tmp is already set
test "$tmp" && return 0
: "${TMPDIR=/tmp}"
# shellcheck disable=SC2039
{ tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } ||
......@@ -262,6 +264,9 @@ case "$UNAME_MACHINE:$UNAME_SYSTEM:$UNAME_RELEASE:$UNAME_VERSION" in
*:SolidBSD:*:*)
echo "$UNAME_MACHINE"-unknown-solidbsd"$UNAME_RELEASE"
exit ;;
*:OS108:*:*)
echo "$UNAME_MACHINE"-unknown-os108_"$UNAME_RELEASE"
exit ;;
macppc:MirBSD:*:*)
echo powerpc-unknown-mirbsd"$UNAME_RELEASE"
exit ;;
......@@ -271,12 +276,15 @@ case "$UNAME_MACHINE:$UNAME_SYSTEM:$UNAME_RELEASE:$UNAME_VERSION" in
*:Sortix:*:*)
echo "$UNAME_MACHINE"-unknown-sortix
exit ;;
*:Twizzler:*:*)
echo "$UNAME_MACHINE"-unknown-twizzler
exit ;;
*:Redox:*:*)
echo "$UNAME_MACHINE"-unknown-redox
exit ;;
mips:OSF1:*.*)
echo mips-dec-osf1
exit ;;
echo mips-dec-osf1
exit ;;
alpha:OSF1:*:*)
case $UNAME_RELEASE in
*4.0)
......@@ -918,7 +926,7 @@ EOF
echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
exit ;;
alpha:Linux:*:*)
case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in
case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' /proc/cpuinfo 2>/dev/null` in
EV5) UNAME_MACHINE=alphaev5 ;;
EV56) UNAME_MACHINE=alphaev56 ;;
PCA56) UNAME_MACHINE=alphapca56 ;;
......@@ -1325,38 +1333,39 @@ EOF
echo "$UNAME_MACHINE"-apple-rhapsody"$UNAME_RELEASE"
exit ;;
*:Darwin:*:*)
UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown
set_cc_for_build
if test "$UNAME_PROCESSOR" = unknown ; then
UNAME_PROCESSOR=powerpc
UNAME_PROCESSOR=`uname -p`
case $UNAME_PROCESSOR in
unknown) UNAME_PROCESSOR=powerpc ;;
esac
if command -v xcode-select > /dev/null 2> /dev/null && \
! xcode-select --print-path > /dev/null 2> /dev/null ; then
# Avoid executing cc if there is no toolchain installed as
# cc will be a stub that puts up a graphical alert
# prompting the user to install developer tools.
CC_FOR_BUILD=no_compiler_found
else
set_cc_for_build
fi
if test "`echo "$UNAME_RELEASE" | sed -e 's/\..*//'`" -le 10 ; then
if [ "$CC_FOR_BUILD" != no_compiler_found ]; then
if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \
(CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \
grep IS_64BIT_ARCH >/dev/null
then
case $UNAME_PROCESSOR in
i386) UNAME_PROCESSOR=x86_64 ;;
powerpc) UNAME_PROCESSOR=powerpc64 ;;
esac
fi
# On 10.4-10.6 one might compile for PowerPC via gcc -arch ppc
if (echo '#ifdef __POWERPC__'; echo IS_PPC; echo '#endif') | \
(CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \
grep IS_PPC >/dev/null
then
UNAME_PROCESSOR=powerpc
fi
if [ "$CC_FOR_BUILD" != no_compiler_found ]; then
if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \
(CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \
grep IS_64BIT_ARCH >/dev/null
then
case $UNAME_PROCESSOR in
i386) UNAME_PROCESSOR=x86_64 ;;
powerpc) UNAME_PROCESSOR=powerpc64 ;;
esac
fi
# On 10.4-10.6 one might compile for PowerPC via gcc -arch ppc
if (echo '#ifdef __POWERPC__'; echo IS_PPC; echo '#endif') | \
(CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \
grep IS_PPC >/dev/null
then
UNAME_PROCESSOR=powerpc
fi
elif test "$UNAME_PROCESSOR" = i386 ; then
# Avoid executing cc on OS X 10.9, as it ships with a stub
# that puts up a graphical alert prompting to install
# developer tools. Any system running Mac OS X 10.7 or
# later (Darwin 11 and later) is required to have a 64-bit
# processor. This is not true of the ARM version of Darwin
# that Apple uses in portable devices.
UNAME_PROCESSOR=x86_64
# uname -m returns i386 or x86_64
UNAME_PROCESSOR=$UNAME_MACHINE
fi
echo "$UNAME_PROCESSOR"-apple-darwin"$UNAME_RELEASE"
exit ;;
......@@ -1468,6 +1477,14 @@ cat > "$dummy.c" <<EOF
#include <sys/types.h>
#include <sys/utsname.h>
#endif
#if defined(ultrix) || defined(_ultrix) || defined(__ultrix) || defined(__ultrix__)
#if defined (vax) || defined (__vax) || defined (__vax__) || defined(mips) || defined(__mips) || defined(__mips__) || defined(MIPS) || defined(__MIPS__)
#include <signal.h>
#if defined(_SIZE_T_) || defined(SIGLOST)
#include <sys/utsname.h>
#endif
#endif
#endif
main ()
{
#if defined (sony)
......@@ -1554,19 +1571,24 @@ main ()
#else
printf ("vax-dec-bsd\n"); exit (0);
#endif
#else
#if defined(_SIZE_T_) || defined(SIGLOST)
struct utsname un;
uname (&un);
printf ("vax-dec-ultrix%s\n", un.release); exit (0);
#else
printf ("vax-dec-ultrix\n"); exit (0);
#endif
#endif
#endif
#if defined(ultrix) || defined(_ultrix) || defined(__ultrix) || defined(__ultrix__)
#if defined(mips) || defined(__mips) || defined(__mips__) || defined(MIPS) || defined(__MIPS__)
#include <signal.h>
#if defined(_SIZE_T_) /* >= ULTRIX4 */
printf ("mips-dec-ultrix4\n"); exit (0);
#if defined(_SIZE_T_) || defined(SIGLOST)
struct utsname *un;
uname (&un);
printf ("mips-dec-ultrix%s\n", un.release); exit (0);
#else
#if defined(ULTRIX3) || defined(ultrix3) || defined(SIGLOST)
printf ("mips-dec-ultrix3\n"); exit (0);
#endif
printf ("mips-dec-ultrix\n"); exit (0);
#endif
#endif
#endif
......@@ -1607,6 +1629,12 @@ copies of config.guess and config.sub with the latest versions from:
https://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess
and
https://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub
EOF
year=`echo $timestamp | sed 's,-.*,,'`
# shellcheck disable=SC2003
if test "`expr "\`date +%Y\`" - "$year"`" -lt 3 ; then
cat >&2 <<EOF
If $0 has already been updated, send the following data and any
information you think might be pertinent to config-patches@gnu.org to
......@@ -1634,6 +1662,7 @@ UNAME_RELEASE = "$UNAME_RELEASE"
UNAME_SYSTEM = "$UNAME_SYSTEM"
UNAME_VERSION = "$UNAME_VERSION"
EOF
fi
exit 1
......
#! /bin/sh
# Configuration validation subroutine script.
# Copyright 1992-2019 Free Software Foundation, Inc.
# Copyright 1992-2020 Free Software Foundation, Inc.
timestamp='2019-01-05'
timestamp='2020-04-24'
# This file is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by
......@@ -67,7 +67,7 @@ Report bugs and patches to <config-patches@gnu.org>."
version="\
GNU config.sub ($timestamp)
Copyright 1992-2019 Free Software Foundation, Inc.
Copyright 1992-2020 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
......@@ -337,17 +337,14 @@ case $1 in
basic_machine=m88k-harris
os=sysv3
;;
hp300)
hp300 | hp300hpux)
basic_machine=m68k-hp
os=hpux
;;
hp300bsd)
basic_machine=m68k-hp
os=bsd
;;
hp300hpux)
basic_machine=m68k-hp
os=hpux
;;
hppaosf)
basic_machine=hppa1.1-hp
os=osf
......@@ -360,10 +357,6 @@ case $1 in
basic_machine=i386-mach
os=mach
;;
vsta)
basic_machine=i386-pc
os=vsta
;;
isi68 | isi)
basic_machine=m68k-isi
os=sysv
......@@ -612,6 +605,10 @@ case $1 in
basic_machine=vax-dec
os=vms
;;
vsta)
basic_machine=i386-pc
os=vsta
;;
vxworks960)
basic_machine=i960-wrs
os=vxworks
......@@ -1172,7 +1169,7 @@ case $cpu-$vendor in
| asmjs \
| ba \
| be32 | be64 \
| bfin | bs2000 \
| bfin | bpf | bs2000 \
| c[123]* | c30 | [cjt]90 | c4x \
| c8051 | clipper | craynv | csky | cydra \
| d10v | d30v | dlx | dsp16xx \
......@@ -1346,11 +1343,11 @@ case $os in
| hpux* | unos* | osf* | luna* | dgux* | auroraux* | solaris* \
| sym* | kopensolaris* | plan9* \
| amigaos* | amigados* | msdos* | newsos* | unicos* | aof* \
| aos* | aros* | cloudabi* | sortix* \
| aos* | aros* | cloudabi* | sortix* | twizzler* \
| nindy* | vxsim* | vxworks* | ebmon* | hms* | mvs* \
| clix* | riscos* | uniplus* | iris* | isc* | rtu* | xenix* \
| knetbsd* | mirbsd* | netbsd* \
| bitrig* | openbsd* | solidbsd* | libertybsd* \
| bitrig* | openbsd* | solidbsd* | libertybsd* | os108* \
| ekkobsd* | kfreebsd* | freebsd* | riscix* | lynxos* \
| bosx* | nextstep* | cxux* | aout* | elf* | oabi* \
| ptx* | coff* | ecoff* | winnt* | domain* | vsta* \
......@@ -1368,7 +1365,8 @@ case $os in
| powermax* | dnix* | nx6 | nx7 | sei* | dragonfly* \
| skyos* | haiku* | rdos* | toppers* | drops* | es* \
| onefs* | tirtos* | phoenix* | fuchsia* | redox* | bme* \
| midnightbsd* | amdhsa* | unleashed* | emscripten* | wasi*)
| midnightbsd* | amdhsa* | unleashed* | emscripten* | wasi* \
| nsk* | powerunix*)
# Remember, each alternative MUST END IN *, to match a version number.
;;
qnx*)
......@@ -1452,9 +1450,6 @@ case $os in
ns2)
os=nextstep2
;;
nsk*)
os=nsk
;;
# Preserve the version number of sinix5.
sinix5.*)
os=`echo $os | sed -e 's|sinix|sysv|'`
......
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
# Generated by GNU Autoconf 2.69 for c-ares 1.15.0.
# Generated by GNU Autoconf 2.69 for c-ares 1.16.0.
#
# Report bugs to <c-ares mailing list: http://cool.haxx.se/mailman/listinfo/c-ares>.
#
......@@ -824,8 +824,8 @@ MAKEFLAGS=
# Identity of this package.
PACKAGE_NAME='c-ares'
PACKAGE_TARNAME='c-ares'
PACKAGE_VERSION='1.15.0'
PACKAGE_STRING='c-ares 1.15.0'
PACKAGE_VERSION='1.16.0'
PACKAGE_STRING='c-ares 1.16.0'
PACKAGE_BUGREPORT='c-ares mailing list: http://cool.haxx.se/mailman/listinfo/c-ares'
PACKAGE_URL=''
......@@ -1619,7 +1619,7 @@ if test "$ac_init_help" = "long"; then
# Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF
\`configure' configures c-ares 1.15.0 to adapt to many kinds of systems.
\`configure' configures c-ares 1.16.0 to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
......@@ -1690,7 +1690,7 @@ fi
if test -n "$ac_init_help"; then
case $ac_init_help in
short | recursive ) echo "Configuration of c-ares 1.15.0:";;
short | recursive ) echo "Configuration of c-ares 1.16.0:";;
esac
cat <<\_ACEOF
......@@ -1831,7 +1831,7 @@ fi
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
c-ares configure 1.15.0
c-ares configure 1.16.0
generated by GNU Autoconf 2.69
Copyright (C) 2012 Free Software Foundation, Inc.
......@@ -2412,7 +2412,7 @@ cat >config.log <<_ACEOF
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
It was created by c-ares $as_me 1.15.0, which was
It was created by c-ares $as_me 1.16.0, which was
generated by GNU Autoconf 2.69. Invocation command line was
$ $0 $@
......@@ -4002,7 +4002,8 @@ $as_echo "$as_me: $xc_bad_var_msg libraries. Use LIBS for: $xc_word" >&6;}
test $xc_bad_var_cflags = yes ||
test $xc_bad_var_ldflags = yes ||
test $xc_bad_var_cppflags = yes; then
as_fn_error $? "Can not continue. Fix errors mentioned immediately above this line." "$LINENO" 5
{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Continuing even with errors mentioned immediately above this line." >&5
$as_echo "$as_me: WARNING: Continuing even with errors mentioned immediately above this line." >&2;}
fi
# Find a good install program. We prefer a C program (faster),
......@@ -5946,7 +5947,7 @@ fi
# Define the identity of the package.
PACKAGE='c-ares'
VERSION='1.15.0'
VERSION='1.16.0'
cat >>confdefs.h <<_ACEOF
......@@ -12232,6 +12233,12 @@ lt_prog_compiler_static=
lt_prog_compiler_pic='-KPIC'
lt_prog_compiler_static='-static'
;;
# flang / f18. f95 an alias for gfortran or flang on Debian
flang* | f18* | f95*)
lt_prog_compiler_wl='-Wl,'
lt_prog_compiler_pic='-fPIC'
lt_prog_compiler_static='-static'
;;
# icc used to be incompatible with GCC.
# ICC 10 doesn't accept -KPIC any more.
icc* | ifort*)
......@@ -32569,7 +32576,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
# report actual input values of CONFIG_FILES etc. instead of their
# values after options handling.
ac_log="
This file was extended by c-ares $as_me 1.15.0, which was
This file was extended by c-ares $as_me 1.16.0, which was
generated by GNU Autoconf 2.69. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
......@@ -32635,7 +32642,7 @@ _ACEOF
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
ac_cs_version="\\
c-ares config.status 1.15.0
c-ares config.status 1.16.0
configured by $0, generated by GNU Autoconf 2.69,
with options \\"\$ac_cs_config\\"
......
AC_PREREQ(2.57)
AC_INIT([c-ares], [1.15.0],
AC_INIT([c-ares], [1.16.0],
[c-ares mailing list: http://cool.haxx.se/mailman/listinfo/c-ares])
XC_OVR_ZZ50
......
......@@ -31,7 +31,7 @@
PROGRAM=libtool
PACKAGE=libtool
VERSION="2.4.6 Debian-2.4.6-6"
VERSION="2.4.6 Debian-2.4.6-11"
package_revision=2.4.6
......@@ -64,7 +64,7 @@ package_revision=2.4.6
# libraries, which are installed to $pkgauxdir.
# Set a version string for this script.
scriptversion=2015-10-04.22; # UTC
scriptversion=2015-01-20.17; # UTC
# General shell script boiler plate, and helper functions.
# Written by Gary V. Vaughan, 2004
......@@ -1091,57 +1091,6 @@ func_relative_path ()
}
# func_quote ARG
# --------------
# Aesthetically quote one ARG, store the result into $func_quote_result. Note
# that we keep attention to performance here (so far O(N) complexity as long as
# func_append is O(1)).
func_quote ()
{
$debug_cmd
func_quote_result=$1
case $func_quote_result in
*[\\\`\"\$]*)
case $func_quote_result in
*[\[\*\?]*)
func_quote_result=`$ECHO "$func_quote_result" | $SED "$sed_quote_subst"`
return 0
;;
esac
func_quote_old_IFS=$IFS
for _G_char in '\' '`' '"' '$'
do
# STATE($1) PREV($2) SEPARATOR($3)
set start "" ""
func_quote_result=dummy"$_G_char$func_quote_result$_G_char"dummy
IFS=$_G_char
for _G_part in $func_quote_result
do
case $1 in
quote)
func_append func_quote_result "$3$2"
set quote "$_G_part" "\\$_G_char"
;;
start)
set first "" ""
func_quote_result=
;;
first)
set quote "$_G_part" ""
;;
esac
done
IFS=$func_quote_old_IFS
done
;;
*) ;;
esac
}
# func_quote_for_eval ARG...
# --------------------------
# Aesthetically quote ARGs to be evaled later.
......@@ -1158,8 +1107,12 @@ func_quote_for_eval ()
func_quote_for_eval_unquoted_result=
func_quote_for_eval_result=
while test 0 -lt $#; do
func_quote "$1"
_G_unquoted_arg=$func_quote_result
case $1 in
*[\\\`\"\$]*)
_G_unquoted_arg=`printf '%s\n' "$1" |$SED "$sed_quote_subst"` ;;
*)
_G_unquoted_arg=$1 ;;
esac
if test -n "$func_quote_for_eval_unquoted_result"; then
func_append func_quote_for_eval_unquoted_result " $_G_unquoted_arg"
else
......@@ -2188,7 +2141,7 @@ include the following information:
compiler: $LTCC
compiler flags: $LTCFLAGS
linker: $LD (gnu? $with_gnu_ld)
version: $progname $scriptversion Debian-2.4.6-6
version: $progname $scriptversion Debian-2.4.6-11
automake: `($AUTOMAKE --version) 2>/dev/null |$SED 1q`
autoconf: `($AUTOCONF --version) 2>/dev/null |$SED 1q`
......@@ -5397,8 +5350,7 @@ else
if test \"\$libtool_execute_magic\" != \"$magic\"; then
file=\"\$0\""
func_quote "$ECHO"
qECHO=$func_quote_result
qECHO=`$ECHO "$ECHO" | $SED "$sed_quote_subst"`
$ECHO "\
# A function that is used when there is no print builtin or printf.
......@@ -7415,10 +7367,11 @@ func_mode_link ()
# -specs=* GCC specs files
# -stdlib=* select c++ std lib with clang
# -fsanitize=* Clang/GCC memory and address sanitizer
# -fuse-ld=* Linker select flags for GCC
-64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*| \
-t[45]*|-txscale*|-p|-pg|--coverage|-fprofile-*|-F*|@*|-tp=*|--sysroot=*| \
-O*|-g*|-flto*|-fwhopr*|-fuse-linker-plugin|-fstack-protector*|-stdlib=*| \
-specs=*|-fsanitize=*)
-specs=*|-fsanitize=*|-fuse-ld=*)
func_quote_for_eval "$arg"
arg=$func_quote_for_eval_result
func_append compile_command " $arg"
......@@ -10655,8 +10608,8 @@ EOF
relink_command="$var=$func_quote_for_eval_result; export $var; $relink_command"
fi
done
func_quote "(cd `pwd`; $relink_command)"
relink_command=$func_quote_result
relink_command="(cd `pwd`; $relink_command)"
relink_command=`$ECHO "$relink_command" | $SED "$sed_quote_subst"`
fi
# Only actually do things if not in dry run mode.
......@@ -10902,8 +10855,7 @@ EOF
done
# Quote the link command for shipping.
relink_command="(cd `pwd`; $SHELL \"$progpath\" $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)"
func_quote "$relink_command"
relink_command=$func_quote_result
relink_command=`$ECHO "$relink_command" | $SED "$sed_quote_subst"`
if test yes = "$hardcode_automatic"; then
relink_command=
fi
......
......@@ -1661,6 +1661,146 @@ AC_DEFUN([CARES_CHECK_FUNC_GETSERVBYPORT_R], [
])
dnl CARES_CHECK_FUNC_GETSERVBYNAME_R
dnl -------------------------------------------------
dnl Verify if getservbyname_r is available, prototyped,
dnl and can be compiled. If all of these are true, and
dnl usage has not been previously disallowed with
dnl shell variable cares_disallow_getservbyname_r, then
dnl HAVE_GETSERVBYNAME_R will be defined.
AC_DEFUN([CARES_CHECK_FUNC_GETSERVBYNAME_R], [
AC_REQUIRE([CARES_INCLUDES_NETDB])dnl
#
tst_links_getservbyname_r="unknown"
tst_proto_getservbyname_r="unknown"
tst_compi_getservbyname_r="unknown"
tst_allow_getservbyname_r="unknown"
tst_nargs_getservbyname_r="unknown"
#
AC_MSG_CHECKING([if getservbyname_r can be linked])
AC_LINK_IFELSE([
AC_LANG_FUNC_LINK_TRY([getservbyname_r])
],[
AC_MSG_RESULT([yes])
tst_links_getservbyname_r="yes"
],[
AC_MSG_RESULT([no])
tst_links_getservbyname_r="no"
])
#
if test "$tst_links_getservbyname_r" = "yes"; then
AC_MSG_CHECKING([if getservbyname_r is prototyped])
AC_EGREP_CPP([getservbyname_r],[
$cares_includes_netdb
],[
AC_MSG_RESULT([yes])
tst_proto_getservbyname_r="yes"
],[
AC_MSG_RESULT([no])
tst_proto_getservbyname_r="no"
])
fi
#
if test "$tst_proto_getservbyname_r" = "yes"; then
if test "$tst_nargs_getservbyname_r" = "unknown"; then
AC_MSG_CHECKING([if getservbyname_r takes 4 args.])
AC_COMPILE_IFELSE([
AC_LANG_PROGRAM([[
$cares_includes_netdb
]],[[
if(0 != getservbyname_r(0, 0, 0, 0))
return 1;
]])
],[
AC_MSG_RESULT([yes])
tst_compi_getservbyname_r="yes"
tst_nargs_getservbyname_r="4"
],[
AC_MSG_RESULT([no])
tst_compi_getservbyname_r="no"
])
fi
if test "$tst_nargs_getservbyname_r" = "unknown"; then
AC_MSG_CHECKING([if getservbyname_r takes 5 args.])
AC_COMPILE_IFELSE([
AC_LANG_PROGRAM([[
$cares_includes_netdb
]],[[
if(0 != getservbyname_r(0, 0, 0, 0, 0))
return 1;
]])
],[
AC_MSG_RESULT([yes])
tst_compi_getservbyname_r="yes"
tst_nargs_getservbyname_r="5"
],[
AC_MSG_RESULT([no])
tst_compi_getservbyname_r="no"
])
fi
if test "$tst_nargs_getservbyname_r" = "unknown"; then
AC_MSG_CHECKING([if getservbyname_r takes 6 args.])
AC_COMPILE_IFELSE([
AC_LANG_PROGRAM([[
$cares_includes_netdb
]],[[
if(0 != getservbyname_r(0, 0, 0, 0, 0, 0))
return 1;
]])
],[
AC_MSG_RESULT([yes])
tst_compi_getservbyname_r="yes"
tst_nargs_getservbyname_r="6"
],[
AC_MSG_RESULT([no])
tst_compi_getservbyname_r="no"
])
fi
AC_MSG_CHECKING([if getservbyname_r is compilable])
if test "$tst_compi_getservbyname_r" = "yes"; then
AC_MSG_RESULT([yes])
else
AC_MSG_RESULT([no])
fi
fi
#
if test "$tst_compi_getservbyname_r" = "yes"; then
AC_MSG_CHECKING([if getservbyname_r usage allowed])
if test "x$cares_disallow_getservbyname_r" != "xyes"; then
AC_MSG_RESULT([yes])
tst_allow_getservbyname_r="yes"
else
AC_MSG_RESULT([no])
tst_allow_getservbyname_r="no"
fi
fi
#
AC_MSG_CHECKING([if getservbyname_r might be used])
if test "$tst_links_getservbyname_r" = "yes" &&
test "$tst_proto_getservbyname_r" = "yes" &&
test "$tst_compi_getservbyname_r" = "yes" &&
test "$tst_allow_getservbyname_r" = "yes"; then
AC_MSG_RESULT([yes])
AC_DEFINE_UNQUOTED(HAVE_GETSERVBYNAME_R, 1,
[Define to 1 if you have the getservbyname_r function.])
AC_DEFINE_UNQUOTED(GETSERVBYNAME_R_ARGS, $tst_nargs_getservbyname_r,
[Specifies the number of arguments to getservbyname_r])
if test "$tst_nargs_getservbyname_r" -eq "4"; then
AC_DEFINE(GETSERVBYNAME_R_BUFSIZE, sizeof(struct servent_data),
[Specifies the size of the buffer to pass to getservbyname_r])
else
AC_DEFINE(GETSERVBYNAME_R_BUFSIZE, 4096,
[Specifies the size of the buffer to pass to getservbyname_r])
fi
ac_cv_func_getservbyname_r="yes"
else
AC_MSG_RESULT([no])
ac_cv_func_getservbyname_r="no"
fi
])
dnl CARES_CHECK_FUNC_INET_NET_PTON
dnl -------------------------------------------------
dnl Verify if inet_net_pton is available, prototyped, can
......
......@@ -4704,6 +4704,12 @@ m4_if([$1], [CXX], [
_LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
_LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
;;
# flang / f18. f95 an alias for gfortran or flang on Debian
flang* | f18* | f95*)
_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
_LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
_LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
;;
# icc used to be incompatible with GCC.
# ICC 10 doesn't accept -KPIC any more.
icc* | ifort*)
......
......@@ -59,7 +59,7 @@ dnl Private macro.
AC_DEFUN([_XC_PROG_CC], [
AC_REQUIRE([_XC_PROG_CC_PREAMBLE])dnl
AC_REQUIRE([XC_CHECK_USER_FLAGS])dnl
AC_REQUIRE([XC_CHECK_BUILD_FLAGS])dnl
AC_REQUIRE([AC_PROG_INSTALL])dnl
AC_REQUIRE([AC_PROG_CC])dnl
AC_REQUIRE([AM_PROG_CC_C_O])dnl
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Update bundled c-ares to version 1.16.0. `Changes <https://c-ares.haxx.se/changelog.html>`_.
Update all the bundled ``config.guess`` and ``config.sub`` scripts.
This diff is collapsed.
......@@ -28,6 +28,7 @@ from __future__ import absolute_import, division, print_function
import binascii
import re
import struct
from gevent.resolver import hostname_types
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment