From: Colin Vidal Date: Mon, 19 Jan 2026 14:52:30 +0000 (+0100) Subject: resolver: add comment when recursing X-Git-Tag: v9.21.18~20^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=bc1a66a1d0cef854120189ea8542a4b01f556738;p=thirdparty%2Fbind9.git resolver: add comment when recursing When a fetch result gets a delegation, `rctx_referral()` sets the `rctx->get_nameserver = true`, which tells the resolver to retry another server, not because of an error with the current server, but simply to follow the delegation. Update the comment of `rctx_nextserver()` which is quite confusing here (as it's not immediately obvious from the code how we recurse when getting a delegation back from a query). Also add a log line, which helps figuring out this is happening. --- diff --git a/lib/dns/resolver.c b/lib/dns/resolver.c index e68686b4ebf..919e518ac96 100644 --- a/lib/dns/resolver.c +++ b/lib/dns/resolver.c @@ -9179,6 +9179,9 @@ again: * rctx_nextserver(): * We found something wrong with the remote server, but it may be * useful to try another one. + * Or nothing is wrong, but the server returned a referral + * (rctx->get_nameservers has been set by rctx_referral()) so we need to try + * again with a new zonecut. */ static void rctx_nextserver(respctx_t *rctx, dns_message_t *message, @@ -9398,6 +9401,7 @@ rctx_done(respctx_t *rctx, isc_result_t result) { if (rctx->next_server) { UNLOCK(&fctx->lock); + FCTXTRACE("nextserver"); rctx_nextserver(rctx, message, addrinfo, result); } else if (rctx->resend) { UNLOCK(&fctx->lock);