]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
if GLUEOK is set, and glue is found in a zone DB, don't check the cache
authorEvan Hunt <each@isc.org>
Mon, 14 Aug 2023 21:28:53 +0000 (14:28 -0700)
committerEvan Hunt <each@isc.org>
Wed, 1 Nov 2023 15:49:08 +0000 (16:49 +0100)
EXPERIMENT: when DNS_DB_GLUEOK is set, dns_view_find() will now return
glue if it is found it a local zone database, without checking to see
if a better answer has been cached previously.

lib/dns/include/dns/view.h
lib/dns/view.c

index 7bfd7ce8928e56456ad5c7615e7b34a0f8ff479f..ea0addf0bd2d4dc4bd573767df49c39ade45a21b 100644 (file)
@@ -548,8 +548,11 @@ dns_view_find(dns_view_t *view, const dns_name_t *name, dns_rdatatype_t type,
  * Notes:
  *
  *\li  See the description of dns_db_find() for information about 'options'.
- *     If the caller sets #DNS_DBFIND_GLUEOK, it must ensure that 'name'
- *     and 'type' are appropriate for glue retrieval.
+
+ *\li  If the caller sets #DNS_DBFIND_GLUEOK, it must ensure that 'name'
+ *     and 'type' are appropriate for glue retrieval. Glue found in a
+ *     zone database will be returned without checking the cache for a
+ *     better answer.
  *
  *\li  If 'now' is zero, then the current time will be used.
  *
index bbf68a6502f1a57060d4b53048e1cb102d24b413..d71892721afe6b252b0a53cc3f32be35532805ca 100644 (file)
@@ -929,29 +929,8 @@ db_find:
                 */
                result = ISC_R_NOTFOUND;
        } else if (result == DNS_R_GLUE) {
-               if (view->cachedb != NULL && !is_staticstub_zone) {
-                       /*
-                        * We found an answer, but the cache may be better.
-                        * Remember what we've got and go look in the cache.
-                        */
-                       is_cache = true;
-                       dns_rdataset_clone(rdataset, &zrdataset);
-                       dns_rdataset_disassociate(rdataset);
-                       if (sigrdataset != NULL &&
-                           dns_rdataset_isassociated(sigrdataset))
-                       {
-                               dns_rdataset_clone(sigrdataset, &zsigrdataset);
-                               dns_rdataset_disassociate(sigrdataset);
-                       }
-                       dns_db_attach(db, &zdb);
-                       dns_db_attachnode(zdb, node, &znode);
-                       dns_db_detachnode(db, &node);
-                       dns_db_detach(&db);
-                       dns_db_attach(view->cachedb, &db);
-                       goto db_find;
-               }
                /*
-                * Otherwise, the glue is the best answer.
+                * Glue is the answer wanted.
                 */
                result = ISC_R_SUCCESS;
        }