Conversation
This was referenced Sep 25, 2026
This was referenced Sep 25, 2026
david-yu
added this pull request to stack #12
September 25, 2026 16:16
get_host_by_name short-circuited numeric literals only when no address
family was requested. With a family set the literal went to c-ares,
which cannot parse a scope id ("fe80::1%eth0" turned into a real DNS
query that failed with ARES_ENOTFOUND) and which returns an IPv4 node
for an AF_INET6 request, so the family was not a filter for literals.
Parse literals with inet_address::parse_numerical regardless of the
requested family. A literal of the other family fails with
ARES_EBADFAMILY, matching what the resolver does for names that only
have records of the other family.
…backs
The error category's hand-written copy of c-ares' error table stops at
ARES_ECANCELLED, so ARES_ESERVICE and ARES_ENOSERVER ("No DNS servers
were configured", the result of every configured server being unusable)
rendered as "Unknown error". Codes the table does not list now get
ares_strerror's text. The listed texts are unchanged, since
applications and their tests match on them; a new test pins them.
ares_socket_functions_ex had aif_nametoindex/aif_indextoname set to
null. c-ares uses them to resolve the %iface suffix of link-local
nameservers and silently drops such servers without them, so a
resolv.conf of "nameserver fe80::1%eth0" lost its only server.
The mock nameserver only ever answered A records, so make_hostent's AF_INET6 branches, reverse lookups of 16-byte addresses, the TCP query path over an IPv6 transport and numeric-literal handling with an explicit family had no coverage. Drive the mock by the question type (A, AAAA, PTR) and add: - test_resolve_aaaa_from_ipv6_nameserver - test_reverse_lookup_ipv6_from_ipv6_nameserver (ip6.arpa PTR) - test_resolve_tcp_ipv6_nameserver - test_resolve_numeric_with_family (literals never reach c-ares; a literal of the other family fails; a %scope suffix is preserved) All IPv6 cases gate on ipv6_available_or_skip().
david-yu
force-pushed
the
ipv6/03-dns-literals-errors
branch
from
September 25, 2026 18:11
af52f44 to
dbfe084
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Part 3 of 10 of the IPv6 series, split out of #1 and rebased on current
scylladb/seastarmaster. Based on #3, so the diff here is only this PR's 3 commits.Why
Three more resolver gaps, which show up once an IPv6 nameserver is reachable:
fe80::1%eth0became a DNS query that failed withARES_ENOTFOUND) and ignores the family for literals. The literal shortcut only ran for an unspecified family, the caseb48ec904amade return whichever family answers first.ARES_ECANCELLED, soARES_ENOSERVER("No DNS servers were configured") printed as "Unknown error". Those codes now get c-ares' own text; the texts already in the table stay, because applications and their tests match on them.aif_nametoindex/aif_indextonamewere null, so c-ares dropped a link-local nameserver (nameserver fe80::1%eth0) whose zone it could not resolve.What
fdcbe43b2)23f154aa8)dbfe0849a) — AAAA answers, ip6.arpa PTR, TCP transport to[::1], literals per family; the mock nameserver now answers by QTYPE.Behaviour change
INET6AF_INETanswer, ignoring the familyARES_EBADFAMILYTesting
test_error_category_textspins the table's texts that applications match on (Not found,Connection refused) and checks that a code the table predates no longer renders as "Unknown error". An earlier version of this PR switched every code toares_strerror; Redpanda's full ducktape run then failed four crash-loop tests whose log allow-lists expectC-Ares:4, unreachable_host.com: Not found.On the core-aws VM (Ubuntu 24.04, GCC 14, C++23, RelWithDebInfo, GnuTLS and OpenSSL in one tree), this PR's head builds and passes
dns,ipv6,socket,rpc,httpd,httpd_openssl,tls,tls_openssl,network_interface,websocketandunix_domainwithSEASTAR_TEST_REQUIRE_IPV6=1, so none of their IPv6 cases skipped.Stack