From 90f29d61d2ce10e70cdf722d310e5081f7ea6423 Mon Sep 17 00:00:00 2001 From: Evan Hunt Date: Sat, 4 May 2024 22:42:36 -0700 Subject: [PATCH] minor findnode optimization when searching for a node so that we can delete an rdataset, it is not necessary to set the 'create' flag. if the node doesn't exist yet, we wouldn't be able delete anything from it. --- lib/dns/resolver.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lib/dns/resolver.c b/lib/dns/resolver.c index f984dbef67..a034d1f1a9 100644 --- a/lib/dns/resolver.c +++ b/lib/dns/resolver.c @@ -5190,7 +5190,7 @@ validated(void *arg) { result = ISC_R_NOTFOUND; if (val->rdataset != NULL) { result = dns_db_findnode(fctx->cache, val->name, - true, &node); + false, &node); } if (result == ISC_R_SUCCESS) { (void)dns_db_deleterdataset(fctx->cache, node, @@ -5815,7 +5815,6 @@ cache_name(fetchctx_t *fctx, dns_name_t *name, dns_message_t *message, /* * Find or create the cache node. */ - node = NULL; result = dns_db_findnode(fctx->cache, name, true, &node); if (result != ISC_R_SUCCESS) { return (result);