Skip to content

Commit

Permalink
fixup! deps: update c-ares to 1.24.0
Browse files Browse the repository at this point in the history
  • Loading branch information
lpinca committed Dec 19, 2023
1 parent ff93e1a commit 25d357b
Show file tree
Hide file tree
Showing 10 changed files with 86 additions and 18 deletions.
42 changes: 28 additions & 14 deletions deps/cares/cares.gyp
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
'cares_sources_common': [
'include/ares.h',
'include/ares_dns.h',
'include/ares_dns_record.h',
'include/ares_nameser.h',
'include/ares_rules.h',
'include/ares_version.h',
Expand All @@ -11,47 +12,59 @@
'src/lib/ares__buf.c',
'src/lib/ares__buf.h',
'src/lib/ares__close_sockets.c',
'src/lib/ares__hosts_file.c',
'src/lib/ares__htable.c',
'src/lib/ares__htable.h',
'src/lib/ares__htable_asvp.c',
'src/lib/ares__htable_asvp.h',
'src/lib/ares__htable_stvp.c',
'src/lib/ares__htable_stvp.h',
'src/lib/ares__htable_strvp.c',
'src/lib/ares__htable_strvp.h',
'src/lib/ares__htable_szvp.c',
'src/lib/ares__htable_szvp.h',
'src/lib/ares__iface_ips.c',
'src/lib/ares__iface_ips.h',
'src/lib/ares__llist.c',
'src/lib/ares__llist.h',
'src/lib/ares__get_hostent.c',
'src/lib/ares__parse_into_addrinfo.c',
'src/lib/ares__read_line.c',
'src/lib/ares__readaddrinfo.c',
'src/lib/ares__slist.c',
'src/lib/ares__slist.h',
'src/lib/ares__socket.c',
'src/lib/ares__sortaddrinfo.c',
'src/lib/ares__threads.c',
'src/lib/ares__timeval.c',
'src/lib/ares_android.c',
'src/lib/ares_android.h',
'src/lib/ares_cancel.c',
'src/lib/ares_create_query.c',
'src/lib/ares_data.c',
'src/lib/ares_data.h',
'src/lib/ares_destroy.c',
'src/lib/ares_dns_mapping.c',
'src/lib/ares_dns_name.c',
'src/lib/ares_dns_parse.c',
'src/lib/ares_dns_record.c',
'src/lib/ares_dns_private.h',
'src/lib/ares_dns_write.c',
'src/lib/ares_expand_name.c',
'src/lib/ares_expand_string.c',
'src/lib/ares_fds.c',
'src/lib/ares_free_hostent.c',
'src/lib/ares_free_string.c',
'src/lib/ares_freeaddrinfo.c',
'src/lib/ares_getaddrinfo.c',
'src/lib/ares_getenv.c',
'src/lib/ares_getenv.h',
'src/lib/ares_gethostbyaddr.c',
'src/lib/ares_gethostbyname.c',
'src/lib/ares_getnameinfo.c',
'src/lib/ares_getsock.c',
'src/lib/ares_inet_net_pton.h',
'src/lib/ares_init.c',
'src/lib/ares_ipv6.h',
'src/lib/ares_library_init.c',
'src/lib/ares_ipv6.h',
'src/lib/ares_math.c',
'src/lib/ares_mkquery.c',
'src/lib/ares_nowarn.c',
'src/lib/ares_nowarn.h',
'src/lib/ares_options.c',
'src/lib/ares_parse_a_reply.c',
'src/lib/ares_parse_aaaa_reply.c',
Expand All @@ -64,24 +77,28 @@
'src/lib/ares_parse_srv_reply.c',
'src/lib/ares_parse_txt_reply.c',
'src/lib/ares_parse_uri_reply.c',
'src/lib/ares_platform.c',
'src/lib/ares_platform.h',
'src/lib/ares_private.h',
'src/lib/ares_process.c',
'src/lib/ares_qcache.c',
'src/lib/ares_query.c',
'src/lib/ares_rand.c',
'src/lib/ares_search.c',
'src/lib/ares_send.c',
'src/lib/ares_setup.h',
'src/lib/ares_strcasecmp.c',
'src/lib/ares_strcasecmp.h',
'src/lib/ares_strdup.c',
'src/lib/ares_strdup.h',
'src/lib/ares_str.c',
'src/lib/ares_str.h',
'src/lib/ares_strerror.c',
'src/lib/ares_strsplit.c',
'src/lib/ares_strsplit.h',
'src/lib/ares_sysconfig.c',
'src/lib/ares_sysconfig_files.c',
'src/lib/ares_timeout.c',
'src/lib/ares_update_servers.c',
'src/lib/ares_version.c',
'src/lib/bitncmp.c',
'src/lib/bitncmp.h',
'src/lib/inet_net_pton.c',
'src/lib/inet_ntop.c',
'src/lib/setup_once.h',
Expand All @@ -91,9 +108,6 @@
'cares_sources_win': [
'src/lib/config-win32.h',
'src/lib/windows_port.c',
'src/lib/ares_getenv.c',
'src/lib/ares_iphlpapi.h',
'src/lib/ares_platform.c',
],
},

Expand Down
6 changes: 6 additions & 0 deletions deps/cares/config/aix/ares_config.h
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,9 @@
/* Define to 1 if you have the gethostname function. */
#define HAVE_GETHOSTNAME 1

/* Define to 1 if you have the getifaddrs function. */
#define HAVE_GETIFADDRS 1

/* Define to 1 if you have the getnameinfo function. */
#define HAVE_GETNAMEINFO 1

Expand All @@ -133,6 +136,9 @@
/* Define to 1 if you have the `gettimeofday' function. */
#define HAVE_GETTIMEOFDAY 1

/* Define to 1 if you have the <ifaddrs.h> header file. */
#define HAVE_IFADDRS_H 1

/* Define to 1 if you have the `if_indextoname' function. */
#define HAVE_IF_INDEXTONAME 1

Expand Down
6 changes: 6 additions & 0 deletions deps/cares/config/android/ares_config.h
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,9 @@
/* Define to 1 if you have the gethostname function. */
#define HAVE_GETHOSTNAME 1

/* Define to 1 if you have the getifaddrs function. */
#define HAVE_GETIFADDRS 1

/* Define to 1 if you have the getnameinfo function. */
#define HAVE_GETNAMEINFO 1

Expand All @@ -133,6 +136,9 @@
/* Define to 1 if you have the `gettimeofday' function. */
#define HAVE_GETTIMEOFDAY 1

/* Define to 1 if you have the <ifaddrs.h> header file. */
#define HAVE_IFADDRS_H 1

/* Define to 1 if you have the `if_indextoname' function. */
#define HAVE_IF_INDEXTONAME 1

Expand Down
6 changes: 6 additions & 0 deletions deps/cares/config/darwin/ares_config.h
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,9 @@
/* Define to 1 if you have the gethostname function. */
#define HAVE_GETHOSTNAME 1

/* Define to 1 if you have the getifaddrs function. */
#define HAVE_GETIFADDRS 1

/* Define to 1 if you have the getnameinfo function. */
#define HAVE_GETNAMEINFO 1

Expand All @@ -133,6 +136,9 @@
/* Define to 1 if you have the `gettimeofday' function. */
#define HAVE_GETTIMEOFDAY 1

/* Define to 1 if you have the <ifaddrs.h> header file. */
#define HAVE_IFADDRS_H 1

/* Define to 1 if you have the `if_indextoname' function. */
#define HAVE_IF_INDEXTONAME 1

Expand Down
6 changes: 6 additions & 0 deletions deps/cares/config/freebsd/ares_config.h
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,9 @@
/* Define to 1 if you have the gethostname function. */
#define HAVE_GETHOSTNAME 1

/* Define to 1 if you have the getifaddrs function. */
#define HAVE_GETIFADDRS 1

/* Define to 1 if you have the getnameinfo function. */
#define HAVE_GETNAMEINFO 1

Expand All @@ -133,6 +136,9 @@
/* Define to 1 if you have the `gettimeofday' function. */
#define HAVE_GETTIMEOFDAY 1

/* Define to 1 if you have the <ifaddrs.h> header file. */
#define HAVE_IFADDRS_H 1

/* Define to 1 if you have the `if_indextoname' function. */
#define HAVE_IF_INDEXTONAME 1

Expand Down
6 changes: 6 additions & 0 deletions deps/cares/config/linux/ares_config.h
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,9 @@
/* Define to 1 if you have the gethostname function. */
#define HAVE_GETHOSTNAME 1

/* Define to 1 if you have the getifaddrs function. */
#define HAVE_GETIFADDRS 1

/* Define to 1 if you have the getnameinfo function. */
#define HAVE_GETNAMEINFO 1

Expand All @@ -133,6 +136,9 @@
/* Define to 1 if you have the `gettimeofday' function. */
#define HAVE_GETTIMEOFDAY 1

/* Define to 1 if you have the <ifaddrs.h> header file. */
#define HAVE_IFADDRS_H 1

/* Define to 1 if you have the `if_indextoname' function. */
#define HAVE_IF_INDEXTONAME 1

Expand Down
6 changes: 6 additions & 0 deletions deps/cares/config/netbsd/ares_config.h
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,9 @@
/* Define to 1 if you have the gethostname function. */
#define HAVE_GETHOSTNAME 1

/* Define to 1 if you have the getifaddrs function. */
#define HAVE_GETIFADDRS 1

/* Define to 1 if you have the getnameinfo function. */
#define HAVE_GETNAMEINFO 1

Expand All @@ -133,6 +136,9 @@
/* Define to 1 if you have the `gettimeofday' function. */
#define HAVE_GETTIMEOFDAY 1

/* Define to 1 if you have the <ifaddrs.h> header file. */
#define HAVE_IFADDRS_H 1

/* Define to 1 if you have the `if_indextoname' function. */
#define HAVE_IF_INDEXTONAME 1

Expand Down
6 changes: 6 additions & 0 deletions deps/cares/config/openbsd/ares_config.h
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,9 @@
/* Define to 1 if you have the gethostname function. */
#define HAVE_GETHOSTNAME 1

/* Define to 1 if you have the getifaddrs function. */
#define HAVE_GETIFADDRS 1

/* Define to 1 if you have the getnameinfo function. */
#define HAVE_GETNAMEINFO 1

Expand All @@ -133,6 +136,9 @@
/* Define to 1 if you have the `gettimeofday' function. */
#define HAVE_GETTIMEOFDAY 1

/* Define to 1 if you have the <ifaddrs.h> header file. */
#define HAVE_IFADDRS_H 1

/* Define to 1 if you have the `if_indextoname' function. */
#define HAVE_IF_INDEXTONAME 1

Expand Down
6 changes: 6 additions & 0 deletions deps/cares/config/sunos/ares_config.h
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,9 @@
/* Define to 1 if you have the gethostname function. */
#define HAVE_GETHOSTNAME 1

/* Define to 1 if you have the getifaddrs function. */
#define HAVE_GETIFADDRS 1

/* Define to 1 if you have the getnameinfo function. */
#define HAVE_GETNAMEINFO 1

Expand All @@ -133,6 +136,9 @@
/* Define to 1 if you have the `gettimeofday' function. */
#define HAVE_GETTIMEOFDAY 1

/* Define to 1 if you have the <ifaddrs.h> header file. */
#define HAVE_IFADDRS_H 1

/* Define to 1 if you have the `if_indextoname' function. */
#define HAVE_IF_INDEXTONAME 1

Expand Down
14 changes: 10 additions & 4 deletions test/parallel/test-dns-resolveany-bad-ancount.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ const dgram = require('dgram');
const dnsPromises = dns.promises;

const server = dgram.createSocket('udp4');
const resolver = new dns.Resolver({ timeout: 100, tries: 1 });
const resolverPromises = new dnsPromises.Resolver({ timeout: 100, tries: 1 });

server.on('message', common.mustCall((msg, { address, port }) => {
const parsed = dnstools.parseDNSPacket(msg);
Expand All @@ -18,16 +20,20 @@ server.on('message', common.mustCall((msg, { address, port }) => {
questions: parsed.questions,
answers: { type: 'A', address: '1.2.3.4', ttl: 123, domain },
});
// Overwrite the # of answers with 2, which is incorrect.
// Overwrite the # of answers with 2, which is incorrect. The response is
// discarded in c-ares >= 1.21.0. This is the reason why a small timeout is
// used in the `Resolver` constructor. See
// https://github.com/nodejs/node/pull/50743#issue-1994909204
buf.writeUInt16LE(2, 6);
server.send(buf, port, address);
}, 2));

server.bind(0, common.mustCall(async () => {
const address = server.address();
dns.setServers([`127.0.0.1:${address.port}`]);
resolver.setServers([`127.0.0.1:${address.port}`]);
resolverPromises.setServers([`127.0.0.1:${address.port}`]);

dnsPromises.resolveAny('example.org')
resolverPromises.resolveAny('example.org')
.then(common.mustNotCall())
.catch(common.expectsError({
// May return EBADRESP or ETIMEOUT
Expand All @@ -36,7 +42,7 @@ server.bind(0, common.mustCall(async () => {
hostname: 'example.org'
}));

dns.resolveAny('example.org', common.mustCall((err) => {
resolver.resolveAny('example.org', common.mustCall((err) => {
assert.notStrictEqual(err.code, 'SUCCESS');
assert.strictEqual(err.syscall, 'queryAny');
assert.strictEqual(err.hostname, 'example.org');
Expand Down

0 comments on commit 25d357b

Please sign in to comment.