]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Fix an issue in dig when retrying with the next server after SERVFAIL
authorAram Sargsyan <aram@isc.org>
Thu, 10 Mar 2022 17:30:34 +0000 (17:30 +0000)
committerAram Sargsyan <aram@isc.org>
Fri, 18 Mar 2022 08:23:53 +0000 (08:23 +0000)
After a query results in a SERVFAIL result, and there is another
registered query in the lookup's queries list, `dig` starts the next
query to try another server, but for some reason, reports about that
also when the current query is in the head of the list, even if there
is no other query in the list to try.

Use the same condition for both decisions, and after starting the next
query, jump to the "detach_query" label instead of "next_lookup",
because there is no need to start the next lookup after we just started
a query in the current lookup.

bin/dig/dighost.c

index 10bf24fc1358e8fe3322eb3bcd96dfc55439bbd1..bd0818d4f4bb3ceee5946ef7efb21804856a55ee 100644 (file)
@@ -3923,15 +3923,6 @@ recv_done(isc_nmhandle_t *handle, isc_result_t eresult, isc_region_t *region,
                        } else {
                                start_udp(next);
                        }
-               }
-
-               /*
-                * If our query is at the head of the list and there
-                * is no next, we're the only one left, so fall
-                * through to print the message.
-                */
-               if ((ISC_LIST_HEAD(l->q) != query) ||
-                   (ISC_LIST_NEXT(query, link) != NULL)) {
                        dighost_comments(l,
                                         "Got %s from %s, trying next "
                                         "server",
@@ -3939,7 +3930,7 @@ recv_done(isc_nmhandle_t *handle, isc_result_t eresult, isc_region_t *region,
                                                 ? "SERVFAIL reply"
                                                 : "recursion not available",
                                         query->servname);
-                       goto next_lookup;
+                       goto detach_query;
                }
        }