]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Replace dns_rbt_namefromnode with dns_name_copy
authorMatthijs Mekking <matthijs@isc.org>
Tue, 16 Jan 2024 10:41:34 +0000 (11:41 +0100)
committerMatthijs Mekking <matthijs@isc.org>
Wed, 6 Mar 2024 08:57:24 +0000 (09:57 +0100)
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.

lib/dns/qp-zonedb.c
lib/dns/qpdb.c

index e9f77f9f88994a5f6eac042818336355f4e0b957..57fcaa5765005580045db94ae6cab85b1e3b292a 100644 (file)
@@ -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);
index 40991dcaa822c49ef9560eb3aba9106e8138db60..540972652b79dd02a3d220dbc6ca472dd72be294 100644 (file)
@@ -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