]> git.ipfire.org Git - thirdparty/bind9.git/commit
Be smarter about refusing to add many RR types to the database
authorOndřej Surý <ondrej@isc.org>
Mon, 17 Jun 2024 09:40:40 +0000 (11:40 +0200)
committerOndřej Surý <ondrej@isc.org>
Mon, 1 Jul 2024 13:04:43 +0000 (15:04 +0200)
commit7f99d7e565ae87d4cd244f2e70f34e7e464e56d4
treed8270525674298e73d365ade424c6b0e3bb83f1c
parent90c7c8078bc4ab89ab249aa2e1d352ec6b56fc16
Be smarter about refusing to add many RR types to the database

Instead of outright refusing to add new RR types to the cache, be a bit
smarter:

1. If the new header type is in our priority list, we always add either
   positive or negative entry at the beginning of the list.

2. If the new header type is negative entry, and we are over the limit,
   we mark it as ancient immediately, so it gets evicted from the cache
   as soon as possible.

3. Otherwise add the new header after the priority headers (or at the
   head of the list).

4. If we are over the limit, evict the last entry on the normal header
   list.

(cherry picked from commit 57cd34441a1b4ecc9874a4a106c2c95b8d7a3120)
lib/dns/rbtdb.c