]> git.ipfire.org Git - thirdparty/bind9.git/commit
Use stale on error also when unable to recurse
authorMatthijs Mekking <matthijs@isc.org>
Thu, 4 Feb 2021 12:57:01 +0000 (13:57 +0100)
committerMatthijs Mekking <matthijs@isc.org>
Mon, 8 Feb 2021 15:10:03 +0000 (16:10 +0100)
commit2afaff75edba5e06060ab1dcae5eb824c725aec9
treec502154230caff460c0eb111dcac0d6f4805cdc0
parente02ce9e83304827a79898c964b648b3ea3210e72
Use stale on error also when unable to recurse

The 'query_usestale()' function was only called when in
'query_gotanswer()' and an unexpected error occurred. This may have
been "quota reached", and thus we were in some cases returning
stale data on fetch-limits (and if serve-stale enabled of course).

But we can also hit fetch-limits when recursing because we are
following a referral (in 'query_notfound()' and
'query_delegation_recurse()'). Here we should also check for using
stale data in case an error occurred.

Specifically don't check for using stale data when refetching a
zero TTL RRset from cache.

Move the setting of DNS_DBFIND_STALESTART into the 'query_usestale()'
function to avoid code duplication.

(cherry picked from commit 8bcd7fe69e5343071fc917738d6092a8b974ef3f)
lib/ns/query.c