]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
avoid retrying a server if its address is unusable
authorJINMEI Tatuya <jtatuya@infoblox.com>
Thu, 30 Oct 2025 04:58:18 +0000 (21:58 -0700)
committerArаm Sаrgsyаn <aram@isc.org>
Mon, 3 Nov 2025 19:37:09 +0000 (19:37 +0000)
Previously, if there's no more server to try in force_next,
it attempted to retry the current server similar to a query
timeout case. But, force_next() is called only when the
current server's address is unusable and the query was not
even sent, so recvcount was not incremented, causing an
assertion failure.

We might be able to fix it so the retry doesn't cause a crash,
but it doesn't make sense to retry the server when its address
is known to be unusable. So, simply avoiding the retry would be
the easiest and safest way to prevent the crash.

bin/dig/dighost.c

index c3516456360521fdcb4fbf123dd07eb8339de3b7..12209c8e6a76d4bf545e67696722d511469593b6 100644 (file)
@@ -3371,19 +3371,11 @@ force_next(dig_query_t *query) {
                return;
        }
 
-       if (l->retries > 1) {
-               l->retries--;
-               debug("making new %s request, %d tries left",
-                     l->tcp_mode ? "TCP" : "UDP", l->retries);
-               requeue_lookup(l, true);
-               lookup_detach(&l);
-               isc_refcount_decrement0(&recvcount);
-               debug("recvcount=%" PRIuFAST32,
-                     isc_refcount_current(&recvcount));
-               query_detach(&query);
-               clear_current_lookup();
-               return;
-       }
+       /*
+        * We don't retry this server unlike other similar cases such as
+        * recv_done() because we're here due to get_address() failure,
+        * which shouldn't be transient.
+        */
 
        if (query->readhandle != NULL) {
                isc_refcount_decrement0(&recvcount);