]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Remove expired rdataset headers from the heap
authorOndřej Surý <ondrej@isc.org>
Tue, 20 Feb 2024 07:50:58 +0000 (08:50 +0100)
committerOndřej Surý <ondrej@isc.org>
Thu, 29 Feb 2024 15:09:34 +0000 (16:09 +0100)
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)

lib/dns/rbtdb.c

index a9ba31fe81926d1505dff756ac1071cbe27fb687..850aae00771fc1a350ff1e22194a30e1485585f3 100644 (file)
@@ -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