]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Remove .delegating flag from the qpcache
authorOndřej Surý <ondrej@isc.org>
Tue, 16 Sep 2025 13:09:14 +0000 (15:09 +0200)
committerOndřej Surý <ondrej@isc.org>
Thu, 27 Nov 2025 09:37:09 +0000 (10:37 +0100)
The .delegating flag was only set, but never used in the dns_qpcache.
Remove it completely together with the code that was locking the node
to set the flag if the added type was DNAME.

lib/dns/qpcache.c

index 476559396f0c19a53354ea584da8c90c44616e0b..219795917439bd8ae52e7bbfce903b23a5c87918 100644 (file)
@@ -126,11 +126,10 @@ struct qpcnode {
 
        qpcache_t *qpdb;
 
-       uint8_t                 : 0;
-       unsigned int delegating : 1;
-       unsigned int nspace     : 2; /*%< range is 0..3 */
-       unsigned int havensec   : 1;
-       uint8_t                 : 0;
+       uint8_t               : 0;
+       unsigned int nspace   : 2; /*%< range is 0..3 */
+       unsigned int havensec : 1;
+       uint8_t               : 0;
 
        /*
         * 'erefs' counts external references held by a caller: for
@@ -3074,7 +3073,6 @@ qpcache_addrdataset(dns_db_t *db, dns_dbnode_t *node, dns_dbversion_t *version,
        isc_region_t region;
        dns_slabheader_t *newheader = NULL;
        isc_result_t result;
-       bool delegating = false;
        bool newnsec = false;
        isc_rwlocktype_t tlocktype = isc_rwlocktype_none;
        isc_rwlocktype_t nlocktype = isc_rwlocktype_none;
@@ -3143,15 +3141,6 @@ qpcache_addrdataset(dns_db_t *db, dns_dbnode_t *node, dns_dbversion_t *version,
 
        nlock = &qpdb->buckets[qpnode->locknum].lock;
 
-       /*
-        * If we're adding a delegation type (which would be an NS or DNAME
-        * for a zone, but only DNAME counts for a cache), we need to set
-        * the callback bit on the node.
-        */
-       if (rdataset->type == dns_rdatatype_dname) {
-               delegating = true;
-       }
-
        /*
         * Add to the auxiliary NSEC tree if we're adding an NSEC record.
         */
@@ -3167,7 +3156,7 @@ qpcache_addrdataset(dns_db_t *db, dns_dbnode_t *node, dns_dbversion_t *version,
         * If we're adding a delegation type or adding to the auxiliary
         * NSEC tree, hold an exclusive lock on the tree.
         */
-       if (delegating || newnsec) {
+       if (newnsec) {
                TREE_WRLOCK(&qpdb->tree_lock, &tlocktype);
        }
 
@@ -3199,10 +3188,6 @@ qpcache_addrdataset(dns_db_t *db, dns_dbnode_t *node, dns_dbversion_t *version,
                DNS_SLABHEADER_SETATTR(newheader, DNS_SLABHEADERATTR_STATCOUNT);
                update_rrsetstats(qpdb->rrsetstats, newheader->typepair,
                                  newheader->attributes, true);
-
-               if (delegating) {
-                       qpnode->delegating = 1;
-               }
        } else {
                dns_slabheader_destroy(&newheader);
        }