From b3c8b5cfb254ce7868ab403ea60db75b5f2c38b6 Mon Sep 17 00:00:00 2001 From: Evan Hunt Date: Tue, 12 Mar 2024 11:51:53 -0700 Subject: [PATCH] remove dead code in rbtdb.c dns_db_addrdataset() enforces a requirement that version can only be NULL for a cache database. code that checks for zone semantics and version == NULL can never be reached. --- lib/dns/rbtdb.c | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/lib/dns/rbtdb.c b/lib/dns/rbtdb.c index d567c99d80..92fb702575 100644 --- a/lib/dns/rbtdb.c +++ b/lib/dns/rbtdb.c @@ -1627,6 +1627,8 @@ dns__rbtdb_setsecure(dns_db_t *db, dns_rbtdb_version_t *version, bool hasnsec = false; isc_result_t result; + REQUIRE(version != NULL); + dns_rdataset_init(&keyset); result = dns_db_findrdataset(db, origin, version, dns_rdatatype_dnskey, 0, 0, &keyset, NULL); @@ -3446,14 +3448,6 @@ dns__rbtdb_addrdataset(dns_db_t *db, dns_dbnode_t *node, } INSIST(tlocktype == isc_rwlocktype_none); - /* - * Update the zone's secure status. If version is non-NULL - * this is deferred until dns__rbtdb_closeversion() is called. - */ - if (result == ISC_R_SUCCESS && version == NULL && !IS_CACHE(rbtdb)) { - dns__rbtdb_setsecure(db, version, rbtdb->origin_node); - } - return (result); }