From: Ondřej Surý Date: Tue, 20 Feb 2024 07:50:58 +0000 (+0100) Subject: Remove expired rdataset headers from the heap X-Git-Tag: v9.16.50~27^2~2 X-Git-Url: http://git.ipfire.org/gitweb/?a=commitdiff_plain;h=abe080d16eac4f5dcca62cb08bd9ca2f82bdaa2b;p=thirdparty%2Fbind9.git Remove expired rdataset headers from the heap It was discovered that an expired header could sit on top of the heap a little longer than desireable. Remove expired headers (headers with rdh_ttl set to 0) from the heap completely, so they don't block the next TTL-based cleaning. (cherry picked from commit a9383e4b95256a65f9f05e64a79b086a9a1ed035) --- diff --git a/lib/dns/rbtdb.c b/lib/dns/rbtdb.c index a9ba31fe819..850aae00771 100644 --- a/lib/dns/rbtdb.c +++ b/lib/dns/rbtdb.c @@ -972,6 +972,10 @@ set_ttl(dns_rbtdb_t *rbtdb, rdatasetheader_t *header, dns_ttl_t newttl) { } else { isc_heap_decreased(heap, header->heap_index); } + + if (newttl == 0) { + isc_heap_delete(heap, header->heap_index); + } } static bool