Skip to content

Commit 3825afe

Browse files
addaleaxMylesBorins
authored andcommitted
deps: upgrade to c-ares v1.16.0
Refs: https://github.com/c-ares/c-ares/releases/tag/cares-1_16_0 PR-URL: #32246 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: David Carlier <devnexen@gmail.com>
1 parent f873d87 commit 3825afe

23 files changed

+2454
-499
lines changed

deps/cares/cares.gyp

+5
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,9 @@
5252
'src/ares_fds.c',
5353
'src/ares_free_hostent.c',
5454
'src/ares_free_string.c',
55+
'src/ares_freeaddrinfo.c',
5556
'src/ares_getenv.h',
57+
'src/ares_getaddrinfo.c',
5658
'src/ares_gethostbyaddr.c',
5759
'src/ares_gethostbyname.c',
5860
'src/ares__get_hostent.c',
@@ -70,6 +72,7 @@
7072
'src/ares_nowarn.c',
7173
'src/ares_nowarn.h',
7274
'src/ares_options.c',
75+
'src/ares__parse_into_addrinfo.c',
7376
'src/ares_parse_aaaa_reply.c',
7477
'src/ares_parse_a_reply.c',
7578
'src/ares_parse_mx_reply.c',
@@ -84,9 +87,11 @@
8487
'src/ares_process.c',
8588
'src/ares_query.c',
8689
'src/ares__read_line.c',
90+
'src/ares__readaddrinfo.c',
8791
'src/ares_search.c',
8892
'src/ares_send.c',
8993
'src/ares_setup.h',
94+
'src/ares__sortaddrinfo.c',
9095
'src/ares_strcasecmp.c',
9196
'src/ares_strcasecmp.h',
9297
'src/ares_strdup.c',

deps/cares/include/ares.h

+59
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,9 @@ extern "C" {
135135
/* More error codes */
136136
#define ARES_ECANCELLED 24 /* introduced in 1.7.0 */
137137

138+
/* More ares_getaddrinfo error codes */
139+
#define ARES_ESERVICE 25 /* introduced in 1.?.0 */
140+
138141
/* Flag values */
139142
#define ARES_FLAG_USEVC (1 << 0)
140143
#define ARES_FLAG_PRIMARY (1 << 1)
@@ -192,6 +195,8 @@ extern "C" {
192195
#define ARES_AI_V4MAPPED (1 << 4)
193196
#define ARES_AI_ALL (1 << 5)
194197
#define ARES_AI_ADDRCONFIG (1 << 6)
198+
#define ARES_AI_NOSORT (1 << 7)
199+
#define ARES_AI_ENVHOSTS (1 << 8)
195200
/* Reserved for future use */
196201
#define ARES_AI_IDN (1 << 10)
197202
#define ARES_AI_IDN_ALLOW_UNASSIGNED (1 << 11)
@@ -278,6 +283,8 @@ struct hostent;
278283
struct timeval;
279284
struct sockaddr;
280285
struct ares_channeldata;
286+
struct ares_addrinfo;
287+
struct ares_addrinfo_hints;
281288

282289
typedef struct ares_channeldata *ares_channel;
283290

@@ -306,6 +313,11 @@ typedef int (*ares_sock_config_callback)(ares_socket_t socket_fd,
306313
int type,
307314
void *data);
308315

316+
typedef void (*ares_addrinfo_callback)(void *arg,
317+
int status,
318+
int timeouts,
319+
struct ares_addrinfo *res);
320+
309321
CARES_EXTERN int ares_library_init(int flags);
310322

311323
CARES_EXTERN int ares_library_init_mem(int flags,
@@ -369,6 +381,15 @@ CARES_EXTERN void ares_set_socket_configure_callback(ares_channel channel,
369381
CARES_EXTERN int ares_set_sortlist(ares_channel channel,
370382
const char *sortstr);
371383

384+
CARES_EXTERN void ares_getaddrinfo(ares_channel channel,
385+
const char* node,
386+
const char* service,
387+
const struct ares_addrinfo_hints* hints,
388+
ares_addrinfo_callback callback,
389+
void* arg);
390+
391+
CARES_EXTERN void ares_freeaddrinfo(struct ares_addrinfo* ai);
392+
372393
/*
373394
* Virtual function set to have user-managed socket IO.
374395
* Note that all functions need to be defined, and when
@@ -558,6 +579,44 @@ struct ares_soa_reply {
558579
unsigned int minttl;
559580
};
560581

582+
/*
583+
* Similar to addrinfo, but with extra ttl and missing canonname.
584+
*/
585+
struct ares_addrinfo_node {
586+
int ai_ttl;
587+
int ai_flags;
588+
int ai_family;
589+
int ai_socktype;
590+
int ai_protocol;
591+
ares_socklen_t ai_addrlen;
592+
struct sockaddr *ai_addr;
593+
struct ares_addrinfo_node *ai_next;
594+
};
595+
596+
/*
597+
* alias - label of the resource record.
598+
* name - value (canonical name) of the resource record.
599+
* See RFC2181 10.1.1. CNAME terminology.
600+
*/
601+
struct ares_addrinfo_cname {
602+
int ttl;
603+
char *alias;
604+
char *name;
605+
struct ares_addrinfo_cname *next;
606+
};
607+
608+
struct ares_addrinfo {
609+
struct ares_addrinfo_cname *cnames;
610+
struct ares_addrinfo_node *nodes;
611+
};
612+
613+
struct ares_addrinfo_hints {
614+
int ai_flags;
615+
int ai_family;
616+
int ai_socktype;
617+
int ai_protocol;
618+
};
619+
561620
/*
562621
** Parse the buffer, starting at *abuf and of length alen bytes, previously
563622
** obtained from an ares_search call. Put the results in *host, if nonnull.

deps/cares/include/ares_version.h

+3-3
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,15 @@
33
#define ARES__VERSION_H
44

55
/* This is the global package copyright */
6-
#define ARES_COPYRIGHT "2004 - 2018 Daniel Stenberg, <daniel@haxx.se>."
6+
#define ARES_COPYRIGHT "2004 - 2020 Daniel Stenberg, <daniel@haxx.se>."
77

88
#define ARES_VERSION_MAJOR 1
9-
#define ARES_VERSION_MINOR 15
9+
#define ARES_VERSION_MINOR 16
1010
#define ARES_VERSION_PATCH 0
1111
#define ARES_VERSION ((ARES_VERSION_MAJOR<<16)|\
1212
(ARES_VERSION_MINOR<<8)|\
1313
(ARES_VERSION_PATCH))
14-
#define ARES_VERSION_STR "1.15.0"
14+
#define ARES_VERSION_STR "1.16.0"
1515

1616
#if (ARES_VERSION >= 0x010700)
1717
# define CARES_HAVE_ARES_LIBRARY_INIT 1

deps/cares/src/README.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,10 @@ c-ares
22
======
33

44
[![Build Status](https://travis-ci.org/c-ares/c-ares.svg?branch=master)](https://travis-ci.org/c-ares/c-ares)
5-
[![Windows Build Status](https://ci.appveyor.com/api/projects/status/03i7151772eq3wn3/branch/master?svg=true)](https://ci.appveyor.com/project/c-ares/c-ares)
5+
[![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)
66
[![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)
77
[![CII Best Practices](https://bestpractices.coreinfrastructure.org/projects/291/badge)](https://bestpractices.coreinfrastructure.org/projects/291)
8+
[![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)
89
[![Releases](https://coderelease.io/badge/c-ares/c-ares)](https://coderelease.io/github/repository/c-ares/c-ares)
910

1011
This is c-ares, an asynchronous resolver library. It is intended for

deps/cares/src/RELEASE-NOTES

+75-33
Original file line numberDiff line numberDiff line change
@@ -1,43 +1,85 @@
1-
c-ares version 1.15.0
1+
c-ares version 1.16.0
22

33
Changes:
4-
o Add ares_init_options() configurability for path to resolv.conf file [1]
5-
o Ability to exclude building of tools (adig, ahost, acountry) in CMake [3]
6-
o Android: Support for domain search suffix [4]
7-
o Report ARES_ENOTFOUND for .onion domain names as per RFC7686. [13]
4+
o Introduction of ares_getaddrinfo() API which provides similar output
5+
(including proper sorting as per RFC 6724) to the system native API, but
6+
utilizes different data structures in order to provide additional information
7+
such as TTLs and all aliases. Please reference the respective man pages for
8+
usage details. [3] [4] [5] [7] [8] [13] [14] [15] [16] [17] [22]
9+
o Parse SOA records from ns_t_any response [29] [30]
10+
o CMake: Provide c-ares version in package export file [24]
11+
o CMake: Add CPACK functionality for DEB and RPM [28]
12+
o CMake: Generate PDB files during build [33] [34]
13+
o CMake: Support manpage installation [37] [38]
814

915
Bug fixes:
10-
o AIX build fix for trying to include both nameser_compat.h and
11-
onameser_compat.h [2]
12-
o Windows: Improve DNS suffixes extracting from WinNT registry [5]
13-
o Fix modern GCC warnings [6]
14-
o Apply the IPv6 server blacklist to all nameserver sources, not just Windows
15-
[7]
16-
o Fix warnings emitted by MSVC when using -W4 [8]
17-
o Prevent changing name servers while queries are outstanding [9]
18-
o Harden and rationalize c-ares timeout computation [10]
19-
o Distribute ares_android.h [11]
20-
o ares_set_servers_csv() on failure should not leave channel in a bad state
21-
[12]
22-
o Add missing docs to distribution
16+
o Fix bad expectation in IPv6 localhost test. [1] [2]
17+
o AutoTools: use XC_CHECK_BUILD_FLAGS instead of XC_CHECK_USER_FLAGS to prevent
18+
complaints about CPPFLAGS in CFLAGS. [6]
19+
o Fix .onion handling
20+
o Command line usage was out of date for adig and ahost. [18]
21+
o Typos in manpages [19] [20]
22+
o If ares_getenv is defined, it must return a value on all platforms [21]
23+
o If /etc/resolv.conf has invalid lookup values, use the defaults. [23]
24+
o Tests: Separate live tests from SetServers* tests as only live tests should
25+
require internet access. [25]
26+
o ares_gethostbyname() should return ENODATA if no valid A or AAAA record is
27+
found, but a CNAME was found. [26] [27]
28+
o CMake: Rework library function checking to prevent unintended linking with
29+
system libraries that aren't needed. [31] [32]
30+
o Due to use of inet_addr() it was not possible to return 255.255.255.255 from
31+
ares_gethostbyname(). [35] [36]
32+
o CMake: Fix building of tests on Windows
2333

2434
Thanks go to these friendly people for their efforts and contributions:
25-
@afalin, Andi Schnebinger, Ben Noordhuis, Brad House, Brad Spencer,
26-
David Hotham, @flyingdutchman23, John Schember, Ruslan Baratov,
27-
Sarat Addepalli, Tobias Nießen (11 contributors)
35+
Abhishek Arya (@inferno-chromium), Adam Majer (@AdamMajer),
36+
Andrew Selivanov (@ki11roy), Ben Noordhuis (@bnoordhuis),
37+
Brad House (@bradh352), Christian Ammer (@ChristianAmmer), Dan Noé (@dnoe),
38+
Daniel Stenberg (@bagder), Darrin Cullop (@dwcullop),
39+
Dron Rathore (@DronRathore), Fabrice Fontaine (@ffontaine),
40+
Gregor Jasny (@gjasny), @kedixa, Khaidi Chu (@XadillaX),
41+
Kyle Edwards (@KyleFromKitware), @lifenjoiner, Michal Rostecki (@mrostecki),
42+
Peter Eisentraut (@petere), Piotr Pietraszkiewicz (@ppietrasa),
43+
Stephen Bryant (@bf-bryants), @tjwalton, Vy Nguyen (@oontvoo)
44+
(22 contributors)
2845

2946
References to bug reports and discussions on issues:
30-
[1] = https://github.com/c-ares/c-ares/issues/220
31-
[2] = https://github.com/c-ares/c-ares/issues/224
32-
[3] = https://github.com/c-ares/c-ares/issues/200
33-
[4] = https://github.com/c-ares/c-ares/issues/207
34-
[5] = https://github.com/c-ares/c-ares/pull/202
35-
[6] = https://github.com/c-ares/c-ares/pull/201
36-
[7] = https://github.com/c-ares/c-ares/pull/193
37-
[8] = https://github.com/c-ares/c-ares/pull/192
38-
[9] = https://github.com/c-ares/c-ares/pull/191
47+
[1] = https://github.com/c-ares/c-ares/pull/227
48+
[2] = https://github.com/c-ares/c-ares/issues/85
49+
[3] = https://github.com/c-ares/c-ares/pull/112
50+
[4] = https://github.com/c-ares/c-ares/pull/233
51+
[5] = https://github.com/c-ares/c-ares/pull/234
52+
[6] = https://github.com/c-ares/c-ares/pull/236
53+
[7] = https://github.com/c-ares/c-ares/pull/235
54+
[8] = https://github.com/c-ares/c-ares/pull/239
55+
[9] = https://github.com/c-ares/c-ares/pull/241
3956
[10] = https://github.com/c-ares/c-ares/pull/187
40-
[11] = https://c-ares.haxx.se/mail/c-ares-archive-2018-04/0000.shtml
41-
[12] = https://c-ares.haxx.se/mail/c-ares-archive-2018-03/0000.shtml
42-
[13] = https://github.com/c-ares/c-ares/issues/196
57+
[11] = https://github.com/c-ares/c-ares/pull/252
58+
[12] = https://github.com/c-ares/c-ares/issues/251
59+
[13] = https://github.com/c-ares/c-ares/pull/258
60+
[14] = https://github.com/c-ares/c-ares/pull/257
61+
[15] = https://github.com/c-ares/c-ares/pull/262
62+
[16] = https://github.com/c-ares/c-ares/pull/264
63+
[17] = https://github.com/c-ares/c-ares/pull/265
64+
[18] = https://github.com/c-ares/c-ares/pull/256
65+
[19] = https://github.com/c-ares/c-ares/pull/269
66+
[20] = https://github.com/c-ares/c-ares/pull/275
67+
[21] = https://github.com/c-ares/c-ares/pull/279
68+
[22] = https://github.com/c-ares/c-ares/pull/290
69+
[23] = https://github.com/c-ares/c-ares/pull/274
70+
[24] = https://github.com/c-ares/c-ares/pull/296
71+
[25] = https://github.com/c-ares/c-ares/pull/299
72+
[26] = https://github.com/c-ares/c-ares/pull/304
73+
[27] = https://github.com/c-ares/c-ares/issues/303
74+
[28] = https://github.com/c-ares/c-ares/pull/283
75+
[29] = https://github.com/c-ares/c-ares/pull/103
76+
[30] = https://github.com/c-ares/c-ares/issues/102
77+
[31] = https://github.com/c-ares/c-ares/pull/310
78+
[32] = https://github.com/c-ares/c-ares/issues/307
79+
[33] = https://github.com/c-ares/c-ares/pull/311
80+
[34] = https://github.com/c-ares/c-ares/issues/245
81+
[35] = https://github.com/c-ares/c-ares/issues/309
82+
[36] = https://github.com/c-ares/c-ares/pull/312
83+
[37] = https://github.com/c-ares/c-ares/issues/297
84+
[38] = https://github.com/c-ares/c-ares/pull/314
4385

deps/cares/src/ares__close_sockets.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -48,14 +48,14 @@ void ares__close_sockets(ares_channel channel, struct server_state *server)
4848
if (server->tcp_socket != ARES_SOCKET_BAD)
4949
{
5050
SOCK_STATE_CALLBACK(channel, server->tcp_socket, 0, 0);
51-
ares__socket_close(channel, server->tcp_socket);
51+
ares__close_socket(channel, server->tcp_socket);
5252
server->tcp_socket = ARES_SOCKET_BAD;
5353
server->tcp_connection_generation = ++channel->tcp_connection_generation;
5454
}
5555
if (server->udp_socket != ARES_SOCKET_BAD)
5656
{
5757
SOCK_STATE_CALLBACK(channel, server->udp_socket, 0, 0);
58-
ares__socket_close(channel, server->udp_socket);
58+
ares__close_socket(channel, server->udp_socket);
5959
server->udp_socket = ARES_SOCKET_BAD;
6060
}
6161
}

deps/cares/src/ares__get_hostent.c

+1-2
Original file line numberDiff line numberDiff line change
@@ -138,8 +138,7 @@ int ares__get_hostent(FILE *fp, int family, struct hostent **host)
138138
addr.addrV4.s_addr = INADDR_NONE;
139139
if ((family == AF_INET) || (family == AF_UNSPEC))
140140
{
141-
addr.addrV4.s_addr = inet_addr(txtaddr);
142-
if (addr.addrV4.s_addr != INADDR_NONE)
141+
if (ares_inet_pton(AF_INET, txtaddr, &addr.addrV4) > 0)
143142
{
144143
/* Actual network address family and length. */
145144
addr.family = AF_INET;

0 commit comments

Comments
 (0)