]> 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 10:48:51 +0000 (12:48 +0200)
commit57cd34441a1b4ecc9874a4a106c2c95b8d7a3120
tree194e4e2dc02c03ebaa0e40d5efcd30730920e068
parent58f660cf2b800963fa649bc9823a626009db3a7e
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.
lib/dns/qpcache.c
lib/dns/rbtdb.c