]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Restore the RECURSIONOK attribute after staleonly
authorMatthijs Mekking <matthijs@isc.org>
Fri, 26 Mar 2021 14:18:01 +0000 (15:18 +0100)
committerMatthijs Mekking <matthijs@isc.org>
Fri, 2 Apr 2021 08:02:40 +0000 (10:02 +0200)
When doing a staleonly lookup we don't want to fallback to recursion.
After all, there are obviously problems with recursion, otherwise we
wouldn't do a staleonly lookup.

When resuming from recursion however, we should restore the
RECURSIONOK flag, allowing future required lookups for this client
to recurse.

lib/ns/query.c

index dbdb355f74a52cba79c1eb658cbbf0d14687417b..04bdd678097e51ca7d732f8e46aa33fd98cd8549 100644 (file)
@@ -6103,6 +6103,13 @@ fetch_callback(isc_task_t *task, isc_event_t *event) {
                return;
        }
 
+       /*
+        * We are resuming from recursion. Reset any attributes, options
+        * that a stale-only lookup may have set.
+        */
+       if (client->view->cachedb != NULL && client->view->recursion) {
+               client->query.attributes |= NS_QUERYATTR_RECURSIONOK;
+       }
        client->query.dboptions &= ~DNS_DBFIND_STALEONLY;
        client->nodetach = false;