From: Mark Andrews Date: Fri, 1 Nov 2024 02:54:52 +0000 (+1100) Subject: Fix dual-stack-servers X-Git-Tag: ondrej/lock-free-qpzone-reads-v1~23^2~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f98a8331aab5e26266f66be4d974da2522f1d2e1;p=thirdparty%2Fbind9.git 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. --- diff --git a/lib/dns/resolver.c b/lib/dns/resolver.c index 73d4815163f..262cb51b685 100644 --- a/lib/dns/resolver.c +++ b/lib/dns/resolver.c @@ -2932,13 +2932,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; + } } } }