]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Fix dig error when trying the next server after a TCP connection failure
authorAram Sargsyan <aram@isc.org>
Sun, 13 Mar 2022 13:47:16 +0000 (13:47 +0000)
committerAram Sargsyan <aram@isc.org>
Fri, 18 Mar 2022 10:28:19 +0000 (10:28 +0000)
When encountering a TCP connection error while trying to initiate a
connection to a server, dig erroneously cancels the lookup even when
there are other server(s) to try, which results in an assertion failure.

Cancel the lookup only when there are no more queries left in the
lookup's queries list (i.e. `next` is NULL).

bin/dig/dighost.c

index 88d355f1007d846cd8561c17bd2a8f91a3c8ffb9..fa813901c7d7167d8c3489894121e66b9bb6c7a5 100644 (file)
@@ -3293,8 +3293,10 @@ tcp_connected(isc_nmhandle_t *handle, isc_result_t eresult, void *arg) {
                        next = NULL;
                }
 
-               cancel_lookup(l);
                query_detach(&query);
+               if (next == NULL) {
+                       cancel_lookup(l);
+               }
                lookup_detach(&l);
 
                if (next != NULL) {