--- /dev/null
+; Copyright (C) 2010 Internet Systems Consortium, Inc. ("ISC")
+;
+; Permission to use, copy, modify, and/or distribute this software for any
+; purpose with or without fee is hereby granted, provided that the above
+; copyright notice and this permission notice appear in all copies.
+;
+; THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
+; REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+; AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
+; INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
+; LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
+; OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+; PERFORMANCE OF THIS SOFTWARE.
+
+; $Id: badparam.db.in,v 1.2.2.2 2010/08/13 07:00:40 marka Exp $
+
+$TTL 300 ; 5 minutes
+@ IN SOA mname1. . (
+ 2010081000 ; serial
+ 20 ; refresh (20 seconds)
+ 20 ; retry (20 seconds)
+ 1814400 ; expire (3 weeks)
+ 3600 ; minimum (1 hour)
+ )
+ NS ns2
+ns2 A 10.53.0.2
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: rbtdb.c,v 1.292.8.10 2010/08/11 22:56:58 jinmei Exp $ */
+/* $Id: rbtdb.c,v 1.292.8.11 2010/08/13 07:00:39 marka Exp $ */
/*! \file */
return (ISC_FALSE);
}
+/*
+ * Find node of the NSEC/NSEC3 record that is 'name'.
+ */
static inline isc_result_t
previous_closest_nsec(dns_rdatatype_t type, rbtdb_search_t *search,
dns_name_t *name, dns_name_t *origin,
dns_rbtnode_t *nsecnode;
isc_result_t result;
+ REQUIRE(nodep != NULL && *nodep == NULL);
+
if (type == dns_rdatatype_nsec3) {
result = dns_rbtnodechain_prev(&search->chain, NULL, NULL);
if (result != ISC_R_SUCCESS && result != DNS_R_NEWORIGIN)
return (result);
result = dns_rbtnodechain_current(&search->chain, name, origin,
nodep);
- if (result != ISC_R_SUCCESS)
- return (result);
- return (ISC_R_SUCCESS);
+ return (result);
}
dns_fixedname_init(&ftarget);
* Try the previous node in the NSEC tree.
*/
result = dns_rbtnodechain_prev(nsecchain,
- name, origin);
+ name, origin);
if (result == DNS_R_NEWORIGIN)
result = ISC_R_SUCCESS;
- } else if (result == ISC_R_NOTFOUND
- || result == DNS_R_PARTIALMATCH) {
+ } else if (result == ISC_R_NOTFOUND ||
+ result == DNS_R_PARTIALMATCH) {
result = dns_rbtnodechain_current(nsecchain,
name, origin, NULL);
if (result == ISC_R_NOTFOUND)
result = dns_rbtnodechain_prev(nsecchain, name, origin);
if (result == DNS_R_NEWORIGIN)
result = ISC_R_SUCCESS;
- if (result != ISC_R_SUCCESS)
- return (result);
}
if (result != ISC_R_SUCCESS)
return (result);
* same name as the node in the auxiliary NSEC tree, except for
* nodes in the auxiliary tree that are awaiting deletion.
*/
- if (result == DNS_R_PARTIALMATCH)
- result = ISC_R_NOTFOUND;
-
- if (result != ISC_R_NOTFOUND) {
+ if (result != DNS_R_PARTIALMATCH && result != ISC_R_NOTFOUND) {
isc_log_write(dns_lctx, DNS_LOGCATEGORY_DATABASE,
DNS_LOGMODULE_CACHE, ISC_LOG_ERROR,
"previous_closest_nsec(): %s",
}
}
+/*
+ * Find the NSEC/NSEC3 which is or before the current point on the
+ * search chain. For NSEC3 records only NSEC3 records that match the
+ * current NSEC3PARAM record are considered.
+ */
static inline isc_result_t
find_closest_nsec(rbtdb_search_t *search, dns_dbnode_t **nodep,
dns_name_t *foundname, dns_rdataset_t *rdataset,
* Use the auxiliary tree only starting with the second node in the
* hope that the original node will be right much of the time.
*/
- dns_fixedname_init(&fname);
- name = dns_fixedname_name(&fname);
- dns_fixedname_init(&forigin);
- origin = dns_fixedname_name(&forigin);
+ dns_fixedname_init(&fname);
+ name = dns_fixedname_name(&fname);
+ dns_fixedname_init(&forigin);
+ origin = dns_fixedname_name(&forigin);
again:
node = NULL;
+ prevnode = NULL;
result = dns_rbtnodechain_current(&search->chain, name, origin, &node);
- if (result != ISC_R_SUCCESS)
- return (result);
+ if (result != ISC_R_SUCCESS)
+ return (result);
do {
NODE_LOCK(&(search->rbtdb->node_locks[node->locknum].lock),
isc_rwlocktype_read);
empty_node = ISC_TRUE;
found = NULL;
foundsig = NULL;
- result = dns_rbtnodechain_prev(&search->chain,
- NULL, NULL);
+ result = previous_closest_nsec(type, search,
+ name, origin,
+ &prevnode, NULL,
+ NULL);
} else if (found != NULL &&
(foundsig != NULL || !need_sig)) {
/*
*/
empty_node = ISC_TRUE;
result = previous_closest_nsec(type, search,
- name, origin, &prevnode,
- &nsecchain, &first);
+ name, origin,
+ &prevnode,
+ &nsecchain,
+ &first);
} else {
/*
* We found an active node, but either the
NODE_UNLOCK(&(search->rbtdb->node_locks[node->locknum].lock),
isc_rwlocktype_read);
node = prevnode;
+ prevnode = NULL;
} while (empty_node && result == ISC_R_SUCCESS);
if (!first)