]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
When a forwarder fails and we're not in a forward-only mode we
authorWitold Kręcicki <wpk@isc.org>
Thu, 3 Jan 2019 12:06:39 +0000 (13:06 +0100)
committerEvan Hunt <each@isc.org>
Wed, 16 Jan 2019 19:09:30 +0000 (11:09 -0800)
go back to regular resolution. When this happens the fetch timer is
already running, and we might end up in a situation where we we create
a fetch for qname-minimized query and after that the timer is triggered
and the query is retried (fctx_try) - which causes relaunching of
qname-minimization fetch - and since we already have a qmin fetch
for this fctx - assertion failure.

This fix stops the timer when doing qname minimization - qmin fetch
internal timer should take care of all the possible timeouts.

CHANGES
lib/dns/resolver.c

diff --git a/CHANGES b/CHANGES
index c3be4bc5b1820fcc8040a18c368858ef4efdd696..201b7f2c248a12d631aba45c0184c932d1d067e7 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,3 +1,7 @@
+5138.  [bug]           Under some circumstances named could hit an assertion
+                       failure when doing qname minimization when using
+                       forwarders. [GL #797]
+
 5137.  [func]          named now logs messages whenever a mirror zone becomes
                        usable or unusable for resolution purposes. [GL #818]
 
index da9083010e530800e890f2fde459d2b08554ba3b..1d63e86ec00fd50e2c7932b1344fd49635159167 100644 (file)
@@ -4040,9 +4040,11 @@ fctx_try(fetchctx_t *fctx, bool retrying, bool badcache) {
                options &= ~DNS_FETCHOPT_QMINIMIZE;
                fctx_increference(fctx);
                task = res->buckets[bucketnum].task;
+               fctx_stoptimer(fctx);
                result = dns_resolver_createfetch(fctx->res, &fctx->qminname,
                                                  fctx->qmintype, &fctx->domain,
-                                                 &fctx->nameservers, NULL, NULL, 0,
+                                                 &fctx->nameservers,
+                                                 NULL, NULL, 0,
                                                  options, 0, fctx->qc, task,
                                                  resume_qmin, fctx,
                                                  &fctx->qminrrset, NULL,
@@ -4371,13 +4373,12 @@ fctx_timeout(isc_task_t *task, isc_event_t *event) {
                 * timer.
                 */
                result = fctx_starttimer(fctx);
-               if (result != ISC_R_SUCCESS)
+               if (result != ISC_R_SUCCESS) {
                        fctx_done(fctx, result, __LINE__);
-               else
-                       /*
-                        * Keep trying.
-                        */
+               } else {
+                       /* Keep trying */
                        fctx_try(fctx, true, false);
+               }
        }
 
        isc_event_free(&event);