]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Change condition for rndc dumpdb -expired
authorMatthijs Mekking <matthijs@isc.org>
Fri, 2 Oct 2020 07:12:23 +0000 (09:12 +0200)
committerMatthijs Mekking <matthijs@isc.org>
Mon, 5 Oct 2020 08:46:14 +0000 (10:46 +0200)
After backporting #1870 to 9.11-S I saw that the condition check there
is different than in the main branch. In 9.11-S "stale" can mean
stale and serve-stale, or not active (awaiting cleanup). In 9.16 and
later versions, "stale" is stale and serve-stale, and "ancient" means
not active (awaiting cleanup). An "ancient" RRset is one that is not
active (TTL expired) and is not eligble for serve-stale.

Update the condition for rndc dumpdb -expired to closer match what is
in 9.11-S.

(cherry picked from commit 5614454c3b37ef342f6b413ea671711b399f3901)

lib/dns/rbtdb.c

index aca23c6f48cf5333817d60bd53c0ba39113d9f81..32e078b8d5b0a4337259dea0f92abacf9a90ad4b 100644 (file)
@@ -3145,7 +3145,7 @@ bind_rdataset(dns_rbtdb_t *rbtdb, dns_rbtnode_t *node, rdatasetheader_t *header,
                rdataset->stale_ttl =
                        (rbtdb->serve_stale_ttl + header->rdh_ttl) - now;
                rdataset->ttl = 0;
-       } else if (header->rdh_ttl < now) {
+       } else if (IS_CACHE(rbtdb) && !ACTIVE(header, now)) {
                rdataset->attributes |= DNS_RDATASETATTR_ANCIENT;
                rdataset->stale_ttl = header->rdh_ttl;
                rdataset->ttl = 0;