2
0
mirror of https://gitlab.isc.org/isc-projects/bind9 synced 2025-08-31 14:35:26 +00:00

don't bother checking for empty nodes when searching the NSEC3 tree

this avoids a time-wasting search that could occur during an
IXFR that replaced an NSEC3 chain.
This commit is contained in:
Evan Hunt
2020-05-08 18:40:41 -07:00
parent fb3a419106
commit 7192edf9c2

View File

@@ -3273,7 +3273,7 @@ activeempty(rbtdb_search_t *search, dns_rbtnodechain_t *chain,
} }
static inline bool static inline bool
activeemtpynode(rbtdb_search_t *search, const dns_name_t *qname, activeemptynode(rbtdb_search_t *search, const dns_name_t *qname,
dns_name_t *wname) { dns_name_t *wname) {
dns_fixedname_t fnext; dns_fixedname_t fnext;
dns_fixedname_t forigin; dns_fixedname_t forigin;
@@ -3504,7 +3504,7 @@ find_wildcard(rbtdb_search_t *search, dns_rbtnode_t **nodep,
NODE_UNLOCK(lock, isc_rwlocktype_read); NODE_UNLOCK(lock, isc_rwlocktype_read);
if (header != NULL || if (header != NULL ||
activeempty(search, &wchain, wname)) { activeempty(search, &wchain, wname)) {
if (activeemtpynode(search, qname, if (activeemptynode(search, qname,
wname)) { wname)) {
return (ISC_R_NOTFOUND); return (ISC_R_NOTFOUND);
} }
@@ -3908,7 +3908,6 @@ zone_find(dns_db_t *db, const dns_name_t *name, dns_dbversion_t *version,
rdatasetheader_t *foundsig, *cnamesig, *nsecsig; rdatasetheader_t *foundsig, *cnamesig, *nsecsig;
rbtdb_rdatatype_t sigtype; rbtdb_rdatatype_t sigtype;
bool active; bool active;
dns_rbtnodechain_t chain;
nodelock_t *lock; nodelock_t *lock;
dns_rbt_t *tree; dns_rbt_t *tree;
@@ -3986,8 +3985,15 @@ zone_find(dns_db_t *db, const dns_name_t *name, dns_dbversion_t *version,
} }
} }
chain = search.chain; active = false;
active = activeempty(&search, &chain, name); if ((options & DNS_DBFIND_FORCENSEC3) == 0) {
/*
* The NSEC3 tree won't have empty nodes,
* so it isn't necessary to check for them.
*/
dns_rbtnodechain_t chain = search.chain;
active = activeempty(&search, &chain, name);
}
/* /*
* If we're here, then the name does not exist, is not * If we're here, then the name does not exist, is not