]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Handle ancient rrsets in bind_rdataset
authorMatthijs Mekking <matthijs@isc.org>
Thu, 3 Sep 2020 13:10:28 +0000 (15:10 +0200)
committerMatthijs Mekking <matthijs@isc.org>
Wed, 23 Sep 2020 14:08:29 +0000 (16:08 +0200)
An ancient RRset is one still in the cache but expired, and awaiting
cleanup.

lib/dns/rbtdb.c

index 3218583c246c008ab7229868c3db9571d5b5d7d8..e23bab0b392cb6a36b7551c52c5dad4a344d22ee 100644 (file)
@@ -3144,7 +3144,12 @@ 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) {
+               rdataset->attributes |= DNS_RDATASETATTR_ANCIENT;
+               rdataset->stale_ttl = 0;
+               rdataset->ttl = 0;
        }
+
        rdataset->private1 = rbtdb;
        rdataset->private2 = node;
        raw = (unsigned char *)header + sizeof(*header);