From: Matthijs Mekking Date: Tue, 16 Jan 2024 10:41:34 +0000 (+0100) Subject: Replace dns_rbt_namefromnode with dns_name_copy X-Git-Tag: v9.19.22~10^2~17 X-Git-Url: http://git.ipfire.org/gitweb/index.cgi?a=commitdiff_plain;h=e95dfc01195e43be6fc144cf0a03e12d2cdcb98f;p=thirdparty%2Fbind9.git Replace dns_rbt_namefromnode with dns_name_copy The name will be stored inside the node now so we can just copy it. These are leftovers, most of the namefromnode code has been replaced already in previous commits. --- diff --git a/lib/dns/qp-zonedb.c b/lib/dns/qp-zonedb.c index e9f77f9f889..57fcaa57650 100644 --- a/lib/dns/qp-zonedb.c +++ b/lib/dns/qp-zonedb.c @@ -2021,8 +2021,7 @@ getsigningtime(dns_db_t *db, dns_rdataset_t *rdataset, rdataset DNS__DB_FLARG_PASS); if (foundname != NULL) { - dns_rbt_fullnamefromnode(QPDB_HEADERNODE(header), - foundname); + dns_name_copy(QPDB_HEADERNODE(header)->name, foundname); } NODE_UNLOCK(&qpdb->node_locks[locknum].lock, &nlocktype); diff --git a/lib/dns/qpdb.c b/lib/dns/qpdb.c index 40991dcaa82..540972652b7 100644 --- a/lib/dns/qpdb.c +++ b/lib/dns/qpdb.c @@ -1037,19 +1037,17 @@ clean_zone_node(dns_rbtnode_t *node, uint32_t least_serial) { */ static void delete_node(dns_qpdb_t *qpdb, dns_rbtnode_t *node) { - dns_name_t *name = NULL; isc_result_t result = ISC_R_UNEXPECTED; INSIST(!ISC_LINK_LINKED(node, deadlink)); if (isc_log_wouldlog(dns_lctx, ISC_LOG_DEBUG(1))) { char printname[DNS_NAME_FORMATSIZE]; + dns_name_format(node->name, printname, sizeof(printname)); isc_log_write(dns_lctx, DNS_LOGCATEGORY_DATABASE, DNS_LOGMODULE_CACHE, ISC_LOG_DEBUG(1), "delete_node(): %p %s (bucket %d)", node, - dns_rbt_formatnodename(node, printname, - sizeof(printname)), - node->locknum); + printname, node->locknum); } switch (node->nsec) { @@ -3707,7 +3705,6 @@ isc_result_t dns__qpdb_nodefullname(dns_db_t *db, dns_dbnode_t *node, dns_name_t *name) { dns_qpdb_t *qpdb = (dns_qpdb_t *)db; dns_rbtnode_t *rbtnode = (dns_rbtnode_t *)node; - isc_result_t result; isc_rwlocktype_t tlocktype = isc_rwlocktype_none; REQUIRE(VALID_QPDB(qpdb)); @@ -3715,10 +3712,10 @@ dns__qpdb_nodefullname(dns_db_t *db, dns_dbnode_t *node, dns_name_t *name) { REQUIRE(name != NULL); TREE_RDLOCK(&qpdb->tree_lock, &tlocktype); - result = dns_rbt_fullnamefromnode(rbtnode, name); + dns_name_copy(rbtnode->name, name); TREE_UNLOCK(&qpdb->tree_lock, &tlocktype); - return (result); + return (ISC_R_SUCCESS); } isc_result_t