]> git.ipfire.org Git - thirdparty/bind9.git/commit
Update code flow in query.c wrt stale data
authorMatthijs Mekking <matthijs@isc.org>
Wed, 20 Jan 2021 15:13:49 +0000 (16:13 +0100)
committerMatthijs Mekking <matthijs@isc.org>
Fri, 29 Jan 2021 09:43:41 +0000 (10:43 +0100)
commit99c72bf5da09aacbefd6cfb6cfcbf77524487302
tree51928e14a383108d66abd73904a1953c75f44201
parent0e62c53c5b12e0b331b22ac7571b6e6792bae469
Update code flow in query.c wrt stale data

First of all, there was a flaw in the code related to the
'stale-refresh-time' option. If stale answers are enabled, and we
returned stale data, then it was assumed that it was because we were
in the 'stale-refresh-time' window. But now we could also have returned
stale data because of a 'stale-answer-client-timeout'. To fix this,
introduce a rdataset attribute DNS_RDATASETATTR_STALE_WINDOW to
indicate whether the stale cache entry was returned because the
'stale-refresh-time' window is active.

Second, remove the special case handling when the result is
DNS_R_NCACHENXRRSET. This can be done more generic in the code block
when dealing with stale data.

Putting all stale case handling in the code block when dealing with
stale data makes the code more easy to follow.

Update documentation to be more verbose and to match then new code
flow.

(cherry picked from commit fa0c9280d23a1e17654e51060aaafa282bd66b50)
lib/dns/include/dns/rdataset.h
lib/dns/rbtdb.c
lib/ns/query.c