]> 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)
committerNicki Křížek <nicki@isc.org>
Wed, 24 Jul 2024 09:06:03 +0000 (11:06 +0200)
commite4d7ce686bb38428eddc7e33b40057d68eca9a6e
treebfedf5f90eab1f6d2d67289796ca8b3770cba53d
parent3e0a67e4bdb253dae3a03a45c1aa117239a3313d
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