]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Cleanup fctx->finds before sending 'final' query after qname minimization.
authorWitold Kręcicki <wpk@isc.org>
Wed, 31 Oct 2018 11:23:57 +0000 (11:23 +0000)
committerWitold Kręcicki <wpk@isc.org>
Mon, 5 Nov 2018 09:57:11 +0000 (09:57 +0000)
At the beginning of qname minimization we get fctx->finds filled with what's
in the cache at this point, in worst case root servers. After doing full
run querying for NSes at different levels we need to clean it and refill
it with proper values from cache.

CHANGES
lib/dns/resolver.c

diff --git a/CHANGES b/CHANGES
index 93a7759d44c66770a109cf94edf538f36192ae37..cf610e3a339e68d6a773ec0be3e8441d3c3a7fc4 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,3 +1,6 @@
+5075.  [bug]           Refresh nameservers from cache when sending final
+                       query in qname minimization. [GL #16]
+
 5074.  [cleanup]       Remove vector socket functions - isc_socket_recvv(),
                        isc_socket_sendtov(), isc_socket_sendtov2(),
                        isc_socket_sendv() - in order to simplify socket code.
index 51b7f18592c8908bc37f41104942b3e76bd4ecd0..b424e77cf8ecc15f615f192723af8602eda1b979 100644 (file)
@@ -4143,6 +4143,15 @@ resume_qmin(isc_task_t *task, isc_event_t *event) {
        fctx->ns_ttl = fctx->nameservers.ttl;
        fctx->ns_ttl_ok = true;
        fctx_minimize_qname(fctx);
+       if (!fctx->minimized) {
+               /*
+                * We have finished minimizing, but fctx->finds was filled at
+                * the beginning of the run - now we need to clear it before
+                * sending the final query to use proper nameservers.
+                */
+               fctx_cancelqueries(fctx, false, false);
+               fctx_cleanupall(fctx);
+       }
        fctx_try(fctx, true, false);
 
  cleanup: