]> 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 14:17:09 +0000 (15:17 +0100)
commit8bcd7fe69e5343071fc917738d6092a8b974ef3f
tree7f5882ed98013658705859e1ed8d0f5de0bbbfaa
parenta4154243399c0e1995cc5b95f89d678425eeccb2
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.
lib/ns/query.c