]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Unify how we handle database version in the cache
authorOndřej Surý <ondrej@isc.org>
Sun, 2 Feb 2025 23:06:48 +0000 (00:06 +0100)
committerEvan Hunt <each@isc.org>
Tue, 18 Feb 2025 20:15:00 +0000 (20:15 +0000)
Database versions are not used in cache databases. Some places in
qpcache.c required the version argument to be NULL; others marked it
as UNUSED. Unify all cases to require version to be NULL.

lib/dns/qpcache.c

index be6bc5ebbf086c4a83577a09072fe9a51da6b5ec..210c2abbbb9c924ee2717a64374e13c3ebce86ce 100644 (file)
@@ -383,8 +383,7 @@ qp_makekey(dns_qpkey_t key, void *uctx ISC_ATTR_UNUSED, void *pval,
 }
 
 static void
-qp_triename(void *uctx, char *buf, size_t size) {
-       UNUSED(uctx);
+qp_triename(void *uctx ISC_ATTR_UNUSED, char *buf, size_t size) {
        snprintf(buf, size, "qpdb-lite");
 }
 
@@ -1631,8 +1630,6 @@ qpcache_find(dns_db_t *db, const dns_name_t *name, dns_dbversion_t *version,
                .now = __now ? __now : isc_stdtime_now(),
        };
 
-       UNUSED(version);
-
        REQUIRE(VALID_QPDB((qpcache_t *)db));
        REQUIRE(version == NULL);
 
@@ -2149,10 +2146,9 @@ qpcache_findrdataset(dns_db_t *db, dns_dbnode_t *node, dns_dbversion_t *version,
        };
 
        REQUIRE(VALID_QPDB(qpdb));
+       REQUIRE(version == NULL);
        REQUIRE(type != dns_rdatatype_any);
 
-       UNUSED(version);
-
        result = ISC_R_SUCCESS;
 
        nlock = &qpdb->buckets[qpnode->locknum].lock;
@@ -2677,8 +2673,7 @@ qpcache_allrdatasets(dns_db_t *db, dns_dbnode_t *node, dns_dbversion_t *version,
        qpc_rditer_t *iterator = NULL;
 
        REQUIRE(VALID_QPDB(qpdb));
-
-       UNUSED(version);
+       REQUIRE(version == NULL);
 
        iterator = isc_mem_get(qpdb->common.mctx, sizeof(*iterator));
        *iterator = (qpc_rditer_t){