From: Matthijs Mekking Date: Thu, 13 Aug 2020 05:47:27 +0000 (+0200) Subject: Include expired rdatasets in iteration functions X-Git-Tag: v9.17.6~35^2~3 X-Git-Url: http://git.ipfire.org/gitweb/?a=commitdiff_plain;h=17d5bd4493d44b4b678ccf98a47c1a4ab928aea8;p=thirdparty%2Fbind9.git Include expired rdatasets in iteration functions By changing the check in 'rdatasetiter_first' and 'rdatasetiter_next' from "now > header->rdh_ttl" to "now - RBDTB_VIRTUAL > header->rdh_ttl" we include expired rdataset entries so that they can be used for "rndc dumpdb -expired". --- diff --git a/lib/dns/rbtdb.c b/lib/dns/rbtdb.c index 5b9536efe3b..3218583c246 100644 --- a/lib/dns/rbtdb.c +++ b/lib/dns/rbtdb.c @@ -9125,13 +9125,13 @@ rdatasetiter_first(dns_rdatasetiter_t *iterator) { * * Note: unlike everywhere else, we * check for now > header->rdh_ttl instead - * of now >= header->rdh_ttl. This allows - * ANY and RRSIG queries for 0 TTL - * rdatasets to work. + * of ">=". This allows ANY and RRSIG + * queries for 0 TTL rdatasets to work. */ if (NONEXISTENT(header) || (now != 0 && - now > header->rdh_ttl + + (now - RBTDB_VIRTUAL) > + header->rdh_ttl + rbtdb->serve_stale_ttl)) { header = NULL; @@ -9209,12 +9209,13 @@ rdatasetiter_next(dns_rdatasetiter_t *iterator) { * * Note: unlike everywhere else, we * check for now > header->ttl instead - * of now >= header->ttl. This allows - * ANY and RRSIG queries for 0 TTL - * rdatasets to work. + * of ">=". This allows ANY and RRSIG + * queries for 0 TTL rdatasets to work. */ if (NONEXISTENT(header) || - (now != 0 && now > header->rdh_ttl)) + (now != 0 && + (now - RBTDB_VIRTUAL) > + header->rdh_ttl)) { header = NULL; }