From: Stephen Morris Date: Fri, 3 Feb 2012 11:39:28 +0000 (+0000) Subject: [1604b] Merge branch 'master' into trac1604b X-Git-Tag: trac2351_base~268 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=3071211d2c537150a691120b0a5ce2b18d010239;p=thirdparty%2Fkea.git [1604b] Merge branch 'master' into trac1604b Conflicts: src/lib/datasrc/memory_datasrc.cc --- 3071211d2c537150a691120b0a5ce2b18d010239 diff --cc src/lib/datasrc/memory_datasrc.cc index 285cee5fef,0263b91d05..450c8b6c14 --- a/src/lib/datasrc/memory_datasrc.cc +++ b/src/lib/datasrc/memory_datasrc.cc @@@ -137,24 -183,23 +183,23 @@@ struct InMemoryZoneFinder::InMemoryZone * * If such condition is found, it throws AddError. */ - void contextCheck(const ConstRRsetPtr& rrset, - const DomainPtr& domain) const { - void contextCheck(const RRset& rrset, const Domain& domain) const { ++ void contextCheck(const AbstractRRset& rrset, const Domain& domain) const { // Ensure CNAME and other type of RR don't coexist for the same - // owner name. - if (rrset->getType() == RRType::CNAME()) { - // TODO: this check will become incorrect when we support DNSSEC - // (depending on how we support DNSSEC). We should revisit it - // at that point. - if (!domain->empty()) { + // owner name except with NSEC, which is the only RR that can coexist + // with CNAME (and also RRSIG, which is handled separately) + if (rrset.getType() == RRType::CNAME()) { + if (find_if(domain.begin(), domain.end(), isNotNSEC) + != domain.end()) { LOG_ERROR(logger, DATASRC_MEM_CNAME_TO_NONEMPTY). - arg(rrset->getName()); + arg(rrset.getName()); isc_throw(AddError, "CNAME can't be added with other data for " - << rrset->getName()); + << rrset.getName()); } - } else if (domain->find(RRType::CNAME()) != domain->end()) { - LOG_ERROR(logger, DATASRC_MEM_CNAME_COEXIST).arg(rrset->getName()); - isc_throw(AddError, "CNAME and " << rrset->getType() << - " can't coexist for " << rrset->getName()); + } else if (rrset.getType() != RRType::NSEC() && + domain.find(RRType::CNAME()) != domain.end()) { + LOG_ERROR(logger, DATASRC_MEM_CNAME_COEXIST).arg(rrset.getName()); + isc_throw(AddError, "CNAME and " << rrset.getType() << + " can't coexist for " << rrset.getName()); } /* @@@ -286,7 -379,7 +379,7 @@@ // Note: there's a slight chance of getting an exception. // As noted in add(), we give up strong exception guarantee in such // cases. - boost::const_pointer_cast(it->second)->addRRsig(sig_rrset); - boost::const_pointer_cast(covered_rrset)->addRRsig(sig_rrset); ++ boost::const_pointer_cast(covered_rrset)->addRRsig(sig_rrset); return (result::SUCCESS); }