summaryrefslogtreecommitdiff
path: root/usr.sbin/nsd/nsec3.c
diff options
context:
space:
mode:
authorFlorian Obser <florian@cvs.openbsd.org>2020-07-23 13:54:09 +0000
committerFlorian Obser <florian@cvs.openbsd.org>2020-07-23 13:54:09 +0000
commit6dfd7562e0a57a90e967dc056b14da8134e28b1f (patch)
tree304d3993170e2caabd7eb15a496e7e6f7642a785 /usr.sbin/nsd/nsec3.c
parent192e57c05513dbb5a9f06c6cae76e752a7ef3fee (diff)
Update to 4.3.2.
Diffstat (limited to 'usr.sbin/nsd/nsec3.c')
-rw-r--r--usr.sbin/nsd/nsec3.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/usr.sbin/nsd/nsec3.c b/usr.sbin/nsd/nsec3.c
index 566b69ca225..ef7c5ee6f96 100644
--- a/usr.sbin/nsd/nsec3.c
+++ b/usr.sbin/nsd/nsec3.c
@@ -396,6 +396,31 @@ nsec3_chain_find_prev(struct zone* zone, struct domain* domain)
return NULL;
}
+
+/** clear hash tree. Called from nsec3_clear_precompile() only. */
+static void
+hash_tree_clear(rbtree_type* tree)
+{
+ if(!tree) return;
+
+ /* Previously (before commit 4ca61188b3f7a0e077476875810d18a5d439871f
+ * and/or svn commit 4776) prehashes and corresponding rbtree nodes
+ * were part of struct nsec3_domain_data. Clearing the hash_tree would
+ * then mean setting the key value of the nodes to NULL to indicate
+ * absence of the prehash.
+ * But since prehash structs are separatly allocated, this is no longer
+ * necessary as currently the prehash structs are simply recycled and
+ * NULLed.
+ *
+ * rbnode_type* n;
+ * for(n=rbtree_first(tree); n!=RBTREE_NULL; n=rbtree_next(n)) {
+ * n->key = NULL;
+ * }
+ */
+ tree->count = 0;
+ tree->root = RBTREE_NULL;
+}
+
void
nsec3_clear_precompile(struct namedb* db, zone_type* zone)
{