aboutsummaryrefslogtreecommitdiff
path: root/iterator/iter_hints.c
diff options
context:
space:
mode:
authorCy Schubert <cy@FreeBSD.org>2025-04-25 14:41:24 +0000
committerCy Schubert <cy@FreeBSD.org>2025-04-25 14:41:24 +0000
commit44bab727dfe28451b777dc9e47db4f748b709182 (patch)
treeb8abab888105843c7f120357a1e010bfd6d5ef8c /iterator/iter_hints.c
parent0a6d797cf6eb751d7eb613900cd19803e05d905f (diff)
Diffstat (limited to 'iterator/iter_hints.c')
-rw-r--r--iterator/iter_hints.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/iterator/iter_hints.c b/iterator/iter_hints.c
index 8b168271c7f0..9faf155ababe 100644
--- a/iterator/iter_hints.c
+++ b/iterator/iter_hints.c
@@ -181,7 +181,7 @@ hints_insert(struct iter_hints* hints, uint16_t c, struct delegpt* dp,
node->noprime = (uint8_t)noprime;
if(!name_tree_insert(&hints->tree, &node->node, dp->name, dp->namelen,
dp->namelabs, c)) {
- char buf[257];
+ char buf[LDNS_MAX_DOMAINLEN];
dname_str(dp->name, buf);
log_err("second hints for zone %s ignored.", buf);
delegpt_free_mlc(dp);
@@ -611,3 +611,14 @@ hints_delete_stub(struct iter_hints* hints, uint16_t c, uint8_t* nm,
name_tree_init_parents(&hints->tree);
if(!nolock) { lock_rw_unlock(&hints->lock); }
}
+
+void
+hints_swap_tree(struct iter_hints* hints, struct iter_hints* data)
+{
+ rbnode_type* oldroot = hints->tree.root;
+ size_t oldcount = hints->tree.count;
+ hints->tree.root = data->tree.root;
+ hints->tree.count = data->tree.count;
+ data->tree.root = oldroot;
+ data->tree.count = oldcount;
+}