From 14bd113b8f10e50c4df4cce948c02739e626dad5 Mon Sep 17 00:00:00 2001 From: Mark Andrews Date: Fri, 1 Nov 2024 13:54:52 +1100 Subject: [PATCH 1/2] Fix dual-stack-servers Named was stopping nameserver address resolution attempts too soon when dual stack servers are configured. Dual stack servers are used when there are *not* addresses for the server in a particular address family so find->status == DNS_ADB_NOMOREADDRESSES is not a sufficient stopping condition when dual stack servers are available. Call fctx_try to see if the alternate servers can be used. (cherry picked from commit f98a8331aab5e26266f66be4d974da2522f1d2e1) --- lib/dns/resolver.c | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/lib/dns/resolver.c b/lib/dns/resolver.c index c73272992c..335637043b 100644 --- a/lib/dns/resolver.c +++ b/lib/dns/resolver.c @@ -2945,13 +2945,17 @@ fctx_finddone(void *arg) { } else { fctx->findfail++; if (atomic_load_acquire(&fctx->pending) == 0) { - /* - * We've got nothing else to wait for - * and don't know the answer. There's - * nothing to do but fail the fctx. - */ FCTX_ATTR_CLR(fctx, FCTX_ATTR_ADDRWAIT); - want_done = true; + if (!ISC_LIST_EMPTY(fctx->res->alternates)) { + want_try = true; + } else { + /* + * We've got nothing else to wait for + * and don't know the answer. There's + * nothing to do but fail the fctx. + */ + want_done = true; + } } } } From c77032caf5e6aa5643e7666e67219c3828bef385 Mon Sep 17 00:00:00 2001 From: Mark Andrews Date: Fri, 1 Nov 2024 14:45:43 +1100 Subject: [PATCH 2/2] Removing now unneeded priming queries Now that fctx_try is being called when adb returns DNS_ADB_NOMOREADDRESSES we don't need these priming queries for the dual-stack-servers test to succeed. (cherry picked from commit 14ab1629b7bd7c6e766216388803bde0fcf97a4f) --- bin/tests/system/resolver/tests.sh | 5 ----- 1 file changed, 5 deletions(-) diff --git a/bin/tests/system/resolver/tests.sh b/bin/tests/system/resolver/tests.sh index 2cb143fd55..eba88fb31d 100755 --- a/bin/tests/system/resolver/tests.sh +++ b/bin/tests/system/resolver/tests.sh @@ -858,11 +858,6 @@ status=$((status + ret)) n=$((n + 1)) echo_i "check that correct namespace is chosen for dual-stack-servers ($n)" ret=0 -# -# The two priming queries are needed until we fix dual-stack-servers fully -# -dig_with_opts @fd92:7065:b8e:ffff::9 v4.nameserver A >dig.out.prime1.${n} || ret=1 -dig_with_opts @fd92:7065:b8e:ffff::9 v4.nameserver AAAA >dig.out.prime2.${n} || ret=1 dig_with_opts @fd92:7065:b8e:ffff::9 foo.v4only.net A >dig.out.ns9.${n} || ret=1 grep "status: NOERROR" dig.out.ns9.${n} >/dev/null || ret=1 if [ $ret != 0 ]; then echo_i "failed"; fi