isc_result_t result;
rbtdb_search_t search;
bool cname_ok = true;
+ bool found_noqname = false;
+ bool all_negative = true;
bool empty_node;
nodelock_t *lock;
isc_rwlocktype_t locktype;
* non-stale rdataset at this node.
*/
empty_node = false;
+ if (header->noqname != NULL &&
+ header->trust == dns_trust_secure) {
+ found_noqname = true;
+ }
+ if (!NEGATIVE(header)) {
+ all_negative = false;
+ }
/*
* If we found a type we were looking for, remember
* meaningfully exist, and that we really have a partial match.
*/
NODE_UNLOCK(lock, locktype);
+ if ((search.options & DNS_DBFIND_COVERINGNSEC) != 0) {
+ result = find_coveringnsec(&search, name, nodep, now,
+ foundname, rdataset,
+ sigrdataset);
+ if (result == DNS_R_COVERINGNSEC) {
+ goto tree_exit;
+ }
+ }
goto find_ns;
}
goto node_exit;
}
+ /*
+ * This name was from a wild card. Look for a covering NSEC.
+ */
+ if (found == NULL && (found_noqname || all_negative) &&
+ (search.options & DNS_DBFIND_COVERINGNSEC) != 0)
+ {
+ NODE_UNLOCK(lock, locktype);
+ result = find_coveringnsec(&search, name, nodep, now,
+ foundname, rdataset,
+ sigrdataset);
+ if (result == DNS_R_COVERINGNSEC) {
+ goto tree_exit;
+ }
+ goto find_ns;
+ }
+
/*
* If there is an NS rdataset at this node, then this is the
* deepest zone cut.