BIND 10 trac1551, updated. ae0979752fd9062a5b184ec855c2f9eab1363aba [1551] used find_if instead of hardcoded conditions to check whether CNAME + non-NSEC is about to coexist.
BIND 10 source code commits
bind10-changes at lists.isc.org
Wed Feb 1 17:38:25 UTC 2012
The branch, trac1551 has been updated
via ae0979752fd9062a5b184ec855c2f9eab1363aba (commit)
from 5883a489bd72fd9a7faa485d770cc74b99457e7f (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit ae0979752fd9062a5b184ec855c2f9eab1363aba
Author: JINMEI Tatuya <jinmei at isc.org>
Date: Wed Feb 1 09:37:50 2012 -0800
[1551] used find_if instead of hardcoded conditions to check whether
CNAME + non-NSEC is about to coexist.
-----------------------------------------------------------------------
Summary of changes:
src/lib/datasrc/memory_datasrc.cc | 14 +++++++++++---
1 files changed, 11 insertions(+), 3 deletions(-)
-----------------------------------------------------------------------
diff --git a/src/lib/datasrc/memory_datasrc.cc b/src/lib/datasrc/memory_datasrc.cc
index ba486c8..ddce599 100644
--- a/src/lib/datasrc/memory_datasrc.cc
+++ b/src/lib/datasrc/memory_datasrc.cc
@@ -17,6 +17,7 @@
#include <utility>
#include <cctype>
#include <cassert>
+
#include <boost/shared_ptr.hpp>
#include <boost/scoped_ptr.hpp>
#include <boost/bind.hpp>
@@ -169,6 +170,14 @@ struct InMemoryZoneFinder::InMemoryZoneFinderImpl {
}
}
+ // A helper predicate used in contextCheck() to check if a given domain
+ // name has a RRset of type different than NSEC.
+ struct IsNotNSEC {
+ bool operator()(const DomainPair& element) const {
+ return (element.second->getType() != RRType::NSEC());
+ }
+ };
+
/*
* Does some checks in context of the data that are already in the zone.
* Currently checks for forbidden combinations of RRsets in the same
@@ -181,9 +190,8 @@ struct InMemoryZoneFinder::InMemoryZoneFinderImpl {
// 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 (!domain.empty() &&
- (domain.size() > 1 ||
- (domain.begin()->second->getType() != RRType::NSEC()))) {
+ if (find_if(domain.begin(), domain.end(), IsNotNSEC())
+ != domain.end()) {
LOG_ERROR(logger, DATASRC_MEM_CNAME_TO_NONEMPTY).
arg(rrset.getName());
isc_throw(AddError, "CNAME can't be added with other data for "
More information about the bind10-changes
mailing list