Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

deps: patch to fix *.onion MX query on c-ares #25840

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions deps/cares/src/ares_create_query.c
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
10 changes: 10 additions & 0 deletions test/parallel/test-dns.js
Original file line number Diff line number Diff line change
Expand Up @@ -314,3 +314,13 @@ common.expectsError(() => {
code: 'ERR_INVALID_CALLBACK',
type: TypeError
});

{
dns.resolveMx('foo.onion', function(err) {
assert.deepStrictEqual(err.errno, 'ENOTFOUND');
assert.deepStrictEqual(err.code, 'ENOTFOUND');
assert.deepStrictEqual(err.syscall, 'queryMx');
assert.deepStrictEqual(err.hostname, 'foo.onion');
assert.deepStrictEqual(err.message, 'queryMx ENOTFOUND foo.onion');
});
}