]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
resolver: add comment when recursing
authorColin Vidal <colin@isc.org>
Mon, 19 Jan 2026 14:52:30 +0000 (15:52 +0100)
committerColin Vidal <colin@isc.org>
Thu, 22 Jan 2026 06:31:00 +0000 (07:31 +0100)
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.

lib/dns/resolver.c

index e68686b4ebfb160601c61e7234ea1b3367618054..919e518ac96cb2ebc21b37763504f56da02d7ae4 100644 (file)
@@ -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);