From: Aram Sargsyan Date: Sun, 13 Mar 2022 13:47:16 +0000 (+0000) Subject: Fix dig error when trying the next server after a TCP connection failure X-Git-Tag: v9.19.0~53^2~2 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=0fb4fc1897c4098df08b10e180db843be172d42d;p=thirdparty%2Fbind9.git Fix dig error when trying the next server after a TCP connection failure 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). --- diff --git a/bin/dig/dighost.c b/bin/dig/dighost.c index 88d355f1007..fa813901c7d 100644 --- a/bin/dig/dighost.c +++ b/bin/dig/dighost.c @@ -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) {