From b4fc8e6294049649bb342b24f0fc0669f0d77779 Mon Sep 17 00:00:00 2001 From: Evan Hunt Date: Fri, 12 Jul 2024 14:06:20 -0700 Subject: [PATCH] minor findnode optimization when searching the cache 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 then we won't be able to delete anything from it anyway. (cherry picked from commit 6b720bfe1aea5e37823a8f95ba59cf84f12573b0) --- 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 5afa72f935..a2fd672d79 100644 --- a/lib/dns/resolver.c +++ b/lib/dns/resolver.c @@ -5220,7 +5220,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, @@ -5858,7 +5858,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);