]> git.ipfire.org Git - thirdparty/bind9.git/commit
Fix serve-stale bug when cache has no data
authorMatthijs Mekking <matthijs@isc.org>
Thu, 20 Apr 2023 14:22:53 +0000 (16:22 +0200)
committerMatthijs Mekking <matthijs@isc.org>
Tue, 30 May 2023 11:46:00 +0000 (13:46 +0200)
commitb90bad93cb960e87fb858de4c1b4583cceb802c2
tree1a8b93b08c2d35c17588ab1a86c6598391d46bc6
parentad5d4473481086813ec48eca3baac893717a132a
Fix serve-stale bug when cache has no data

We recently fixed a bug where in some cases (when following an
expired CNAME for example), named could return SERVFAIL if the target
record is still valid (see isc-projects/bind9#3678, and
isc-projects/bind9!7096). We fixed this by considering non-stale
RRsets as well during the stale lookup.

However, this triggered a new bug because despite the answer from
cache not being stale, the lookup may be triggered by serve-stale.
If the answer from database is not stale, the fix in
isc-projects/bind9!7096 erroneously skips the serve-stale logic.

Add 'answer_found' checks to the serve-stale logic to fix this issue.

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