summaryrefslogtreecommitdiff
path: root/usr.sbin/unbound/util/storage/dnstree.c
diff options
context:
space:
mode:
authorStuart Henderson <sthen@cvs.openbsd.org>2022-10-20 08:26:15 +0000
committerStuart Henderson <sthen@cvs.openbsd.org>2022-10-20 08:26:15 +0000
commit5f037c8aad4bc789f846be5f975c63b37296275b (patch)
tree3e1c385ea62052348f9f8431c2f10072c823f2a2 /usr.sbin/unbound/util/storage/dnstree.c
parentb528c8e58143aeb27a71ade420fe2fecb5da5bb9 (diff)
merge unbound 1.17.0
Diffstat (limited to 'usr.sbin/unbound/util/storage/dnstree.c')
-rw-r--r--usr.sbin/unbound/util/storage/dnstree.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/usr.sbin/unbound/util/storage/dnstree.c b/usr.sbin/unbound/util/storage/dnstree.c
index f883044afa4..eef393f91b6 100644
--- a/usr.sbin/unbound/util/storage/dnstree.c
+++ b/usr.sbin/unbound/util/storage/dnstree.c
@@ -71,6 +71,14 @@ int addr_tree_compare(const void* k1, const void* k2)
return 0;
}
+int addr_tree_addrport_compare(const void* k1, const void* k2)
+{
+ struct addr_tree_node* n1 = (struct addr_tree_node*)k1;
+ struct addr_tree_node* n2 = (struct addr_tree_node*)k2;
+ return sockaddr_cmp(&n1->addr, n1->addrlen, &n2->addr,
+ n2->addrlen);
+}
+
void name_tree_init(rbtree_type* tree)
{
rbtree_init(tree, &name_tree_compare);
@@ -81,6 +89,11 @@ void addr_tree_init(rbtree_type* tree)
rbtree_init(tree, &addr_tree_compare);
}
+void addr_tree_addrport_init(rbtree_type* tree)
+{
+ rbtree_init(tree, &addr_tree_addrport_compare);
+}
+
int name_tree_insert(rbtree_type* tree, struct name_tree_node* node,
uint8_t* name, size_t len, int labs, uint16_t dclass)
{