|
@@ -179,8 +179,7 @@ private:
|
|
|
|
|
|
DatabaseClient::Finder::FoundRRsets
|
|
|
DatabaseClient::Finder::getRRsets(const string& name, const WantedTypes& types,
|
|
|
- bool check_ns, const string* construct_name,
|
|
|
- bool any,
|
|
|
+ const string* construct_name, bool any,
|
|
|
DatabaseAccessor::IteratorContextPtr context)
|
|
|
{
|
|
|
RRsigStore sig_store;
|
|
@@ -279,10 +278,6 @@ DatabaseClient::Finder::getRRsets(const string& name, const WantedTypes& types,
|
|
|
isc_throw(DataSourceError, "CNAME shares domain " << name <<
|
|
|
" with something else");
|
|
|
}
|
|
|
- if (check_ns && /*seen_ns*/ false && seen_other) {
|
|
|
- isc_throw(DataSourceError, "NS shares domain " << name <<
|
|
|
- " with something else");
|
|
|
- }
|
|
|
// Add signatures to all found RRsets
|
|
|
for (std::map<RRType, RRsetPtr>::iterator i(result.begin());
|
|
|
i != result.end(); ++ i) {
|
|
@@ -460,7 +455,7 @@ DatabaseClient::Finder::findDelegationPoint(const isc::dns::Name& name,
|
|
|
// Look if there's NS or DNAME at this point of the tree, but ignore
|
|
|
// the NS RRs at the apex of the zone.
|
|
|
const FoundRRsets found = getRRsets(superdomain.toText(),
|
|
|
- DELEGATION_TYPES(), not_origin);
|
|
|
+ DELEGATION_TYPES());
|
|
|
if (found.first) {
|
|
|
// This node contains either NS or DNAME RRs so it does exist.
|
|
|
const FoundIterator nsi(found.second.find(RRType::NS()));
|
|
@@ -587,8 +582,9 @@ DatabaseClient::Finder::findWildcardMatch(
|
|
|
// TODO Add a check for DNAME, as DNAME wildcards are discouraged (see
|
|
|
// RFC 4592 section 4.4).
|
|
|
// Search for a match. The types are the same as with original query.
|
|
|
- FoundRRsets found = getRRsets(wildcard, final_types, true,
|
|
|
- &construct_name, type == RRType::ANY());
|
|
|
+ const FoundRRsets found = getRRsets(wildcard, final_types,
|
|
|
+ &construct_name,
|
|
|
+ type == RRType::ANY());
|
|
|
if (found.first) {
|
|
|
// Found something - but what?
|
|
|
|
|
@@ -691,7 +687,7 @@ DatabaseClient::Finder::FindDNSSECContext::probe() {
|
|
|
// such cases).
|
|
|
const string origin = finder_.getOrigin().toText();
|
|
|
const FoundRRsets nsec3_found =
|
|
|
- finder_.getRRsets(origin, NSEC3PARAM_TYPES(), false);
|
|
|
+ finder_.getRRsets(origin, NSEC3PARAM_TYPES());
|
|
|
const FoundIterator nfi=
|
|
|
nsec3_found.second.find(RRType::NSEC3PARAM());
|
|
|
is_nsec3_ = (nfi != nsec3_found.second.end());
|
|
@@ -702,7 +698,7 @@ DatabaseClient::Finder::FindDNSSECContext::probe() {
|
|
|
// described in Section 10.4 of RFC 5155.
|
|
|
if (!is_nsec3_) {
|
|
|
const FoundRRsets nsec_found =
|
|
|
- finder_.getRRsets(origin, NSEC_TYPES(), false);
|
|
|
+ finder_.getRRsets(origin, NSEC_TYPES());
|
|
|
const FoundIterator nfi =
|
|
|
nsec_found.second.find(RRType::NSEC());
|
|
|
is_nsec_ = (nfi != nsec_found.second.end());
|
|
@@ -754,10 +750,8 @@ DatabaseClient::Finder::FindDNSSECContext::getDNSSECRRset(const Name &name,
|
|
|
try {
|
|
|
const Name& nsec_name =
|
|
|
covering ? finder_.findPreviousName(name) : name;
|
|
|
- const bool need_nscheck = (nsec_name != finder_.getOrigin());
|
|
|
const FoundRRsets found = finder_.getRRsets(nsec_name.toText(),
|
|
|
- NSEC_TYPES(),
|
|
|
- need_nscheck);
|
|
|
+ NSEC_TYPES());
|
|
|
const FoundIterator nci = found.second.find(RRType::NSEC());
|
|
|
if (nci != found.second.end()) {
|
|
|
return (nci->second);
|
|
@@ -985,8 +979,7 @@ DatabaseClient::Finder::findInternal(const Name& name, const RRType& type,
|
|
|
WantedTypes final_types(FINAL_TYPES());
|
|
|
final_types.insert(type);
|
|
|
const FoundRRsets found = getRRsets(name.toText(), final_types,
|
|
|
- !is_origin, NULL,
|
|
|
- type == RRType::ANY());
|
|
|
+ NULL, type == RRType::ANY());
|
|
|
FindDNSSECContext dnssec_ctx(*this, options);
|
|
|
if (found.first) {
|
|
|
// Something found at the domain name. Look into it further to get
|
|
@@ -1018,7 +1011,7 @@ DatabaseClient::Finder::findNSEC3(const Name& name, bool recursive) {
|
|
|
// Now, we need to get the NSEC3 params from the apex and create the hash
|
|
|
// creator for it.
|
|
|
const FoundRRsets nsec3param(getRRsets(getOrigin().toText(),
|
|
|
- NSEC3PARAM_TYPES(), false));
|
|
|
+ NSEC3PARAM_TYPES()));
|
|
|
const FoundIterator param(nsec3param.second.find(RRType::NSEC3PARAM()));
|
|
|
if (!nsec3param.first || param == nsec3param.second.end()) {
|
|
|
// No NSEC3 params? :-(
|
|
@@ -1058,7 +1051,7 @@ DatabaseClient::Finder::findNSEC3(const Name& name, bool recursive) {
|
|
|
}
|
|
|
|
|
|
const FoundRRsets nsec3(getRRsets(hash + "." + otext, NSEC3_TYPES(),
|
|
|
- false, NULL, false, context));
|
|
|
+ NULL, false, context));
|
|
|
|
|
|
if (nsec3.first) {
|
|
|
// We found an exact match against the current label.
|
|
@@ -1083,8 +1076,8 @@ DatabaseClient::Finder::findNSEC3(const Name& name, bool recursive) {
|
|
|
arg(labels).arg(prevHash);
|
|
|
context = accessor_->getNSEC3Records(prevHash, zone_id_);
|
|
|
const FoundRRsets prev_nsec3(getRRsets(prevHash + "." + otext,
|
|
|
- NSEC3_TYPES(), false, NULL,
|
|
|
- false, context));
|
|
|
+ NSEC3_TYPES(), NULL, false,
|
|
|
+ context));
|
|
|
|
|
|
if (!prev_nsec3.first) {
|
|
|
isc_throw(DataSourceError, "Hash " + prevHash + " returned "
|