]> 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>
Fri, 25 Sep 2020 06:21:02 +0000 (08:21 +0200)
An ancient RRset is one still in the cache but expired, and awaiting
cleanup.

(cherry picked from commit 388cc666e51b90d46c4bcd8cb70d14196c923292)

lib/dns/rbtdb.c

index c0e90e150d8333c7b058a8ddfdbc1808f6f17fc1..cb714409bb4cc133555d85066ddcfa15aaff97c1 100644 (file)
@@ -3145,7 +3145,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);