From 4d6408b82362c71ea04520083a3c6f4336ea4a1d Mon Sep 17 00:00:00 2001 From: Diego Fronza Date: Mon, 29 Mar 2021 14:04:12 -0300 Subject: [PATCH 1/2] Fix following up lookup failure if more resolvers are available _query_detach function was incorrectly unliking the query object from the lookup->q query list, this made it impossible to follow a query lookup failure with the next one in the list (possibly using a separate resolver), as the link to the next query in the list was dissolved. Fix by unliking the node only when the query object is about to be destroyed, i.e. there is no more references to the object. --- bin/dig/dighost.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/bin/dig/dighost.c b/bin/dig/dighost.c index 9473219c2a..a4a2ebdaf1 100644 --- a/bin/dig/dighost.c +++ b/bin/dig/dighost.c @@ -1692,14 +1692,13 @@ _query_detach(dig_query_t **queryp, const char *file, unsigned int line) { query_detach(&lookup->current_query); } - if (ISC_LINK_LINKED(query, link)) { - ISC_LIST_UNLINK(lookup->q, query, link); - } - debug("%s:%u:query_detach(%p) = %" PRIuFAST32, file, line, query, isc_refcount_current(&query->references) - 1); if (isc_refcount_decrement(&query->references) == 1) { + if (ISC_LINK_LINKED(query, link)) { + ISC_LIST_UNLINK(lookup->q, query, link); + } destroy_query(query, file, line); } } From f2d00069c3ecbb402f7a2c6f399220cebdd934b1 Mon Sep 17 00:00:00 2001 From: Mark Andrews Date: Thu, 11 Mar 2021 14:37:19 +1100 Subject: [PATCH 2/2] Add CHANGES note for [GL #2564] --- CHANGES | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CHANGES b/CHANGES index 0561ee1770..24b36eb72a 100644 --- a/CHANGES +++ b/CHANGES @@ -1,3 +1,6 @@ +5628. [bug] Host and nslookup could die on SERVFAIL response. + [GL #2564] + 5627. [bug] RRSIG(SOA) RRsets placed anywhere else than at zone apex were triggering infinite resigning loops. This has been fixed. [GL #2650]