]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Reclaim only what the new delegation needs
authorOndřej Surý <ondrej@isc.org>
Thu, 9 Apr 2026 10:46:45 +0000 (12:46 +0200)
committerColin Vidal <colin@isc.org>
Thu, 16 Apr 2026 09:28:13 +0000 (11:28 +0200)
delegdb_cleanup() was overwriting the caller-supplied 'requested'
value with (hiwater - lowater), so every overmem cleanup tried to
free the full watermark band regardless of how much memory the new
delegation actually needed.  Drop the override so the caller's size
is used: we now walk the SIEVE only until we have reclaimed enough
room for the new node, leaving unrelated entries in place.

lib/dns/deleg.c

index df989c3b742cf0ca5c5147cfcacd14e5b4bb87e8..ae03ed1ddae3e4467e12f342e61fa88254f34e35 100644 (file)
@@ -465,7 +465,6 @@ delegdb_cleanup(dns_qp_t *qp, dns_delegdb_t *delegdb, size_t requested) {
        if (!isc_mem_isovermem(delegdb->mctx)) {
                return;
        }
-       requested = delegdb->hiwater - delegdb->lowater;
 
        while (reclaimed < requested) {
                node = ISC_SIEVE_NEXT(delegdb->lru[isc_tid()], visited, link);