From: Matthijs Mekking Date: Fri, 26 Mar 2021 14:18:01 +0000 (+0100) Subject: Restore the RECURSIONOK attribute after staleonly X-Git-Tag: v9.17.12~16^2~2 X-Git-Url: http://git.ipfire.org/gitweb/index.cgi?a=commitdiff_plain;h=3f81d79ffbfc3eb5bd6bf7d8663af5ab705db53b;p=thirdparty%2Fbind9.git Restore the RECURSIONOK attribute after staleonly 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. --- diff --git a/lib/ns/query.c b/lib/ns/query.c index dbdb355f74a..04bdd678097 100644 --- a/lib/ns/query.c +++ b/lib/ns/query.c @@ -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;