]> 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 13:32:24 +0000 (15:32 +0200)
commit2cce83e0d7bdd332f421e34d1d13a7fd814ab656
tree40f6b41598c8365199392504939f194e7acf9bab
parent2d5b975f3a25f03d748003e8ebcf54d63bd465dc
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