BIND 10 trac1574b, updated. 13ef8a1a140dd572deeb4f971109e2fe4a8363ac [1574b] used ::toupper instead of a helper functor object with transform(). g++ somehow seems to require it to compile with toupper. updated comments about it.
BIND 10 source code commits
bind10-changes at lists.isc.org
Tue Jan 31 18:12:33 UTC 2012
The branch, trac1574b has been updated
via 13ef8a1a140dd572deeb4f971109e2fe4a8363ac (commit)
via c653a1bd0fa764039207f5ed1375acaa4170e8e5 (commit)
via 8b51e48caf77ca64a06e1a3206445b1fe0b33261 (commit)
via f2ae6da3091138750b4bf51475c781e3d7ddc5f1 (commit)
from d69234b667207783c40d1f4b021ac50682fe2341 (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 13ef8a1a140dd572deeb4f971109e2fe4a8363ac
Author: JINMEI Tatuya <jinmei at isc.org>
Date: Tue Jan 31 10:11:39 2012 -0800
[1574b] used ::toupper instead of a helper functor object with transform().
g++ somehow seems to require it to compile with toupper. updated comments
about it.
commit c653a1bd0fa764039207f5ed1375acaa4170e8e5
Author: JINMEI Tatuya <jinmei at isc.org>
Date: Tue Jan 31 10:04:16 2012 -0800
[1574b] updated some comments so they'll be less confusing
commit 8b51e48caf77ca64a06e1a3206445b1fe0b33261
Author: JINMEI Tatuya <jinmei at isc.org>
Date: Tue Jan 31 10:02:44 2012 -0800
[1574b] added a comment about why ZoneData::origin_data_ is safe to access
in InMemoryZoneFinder::load()
commit f2ae6da3091138750b4bf51475c781e3d7ddc5f1
Author: JINMEI Tatuya <jinmei at isc.org>
Date: Tue Jan 31 09:57:57 2012 -0800
[1574b] fixed typo in comments
-----------------------------------------------------------------------
Summary of changes:
src/lib/datasrc/memory_datasrc.cc | 33 +++++++++++----------
src/lib/dns/python/tests/nsec3hash_python_test.py | 2 +-
src/lib/dns/tests/nsec3hash_unittest.cc | 2 +-
3 files changed, 19 insertions(+), 18 deletions(-)
-----------------------------------------------------------------------
diff --git a/src/lib/datasrc/memory_datasrc.cc b/src/lib/datasrc/memory_datasrc.cc
index 6bcf75f..0a3280b 100644
--- a/src/lib/datasrc/memory_datasrc.cc
+++ b/src/lib/datasrc/memory_datasrc.cc
@@ -241,7 +241,7 @@ struct InMemoryZoneFinder::InMemoryZoneFinderImpl {
<< rrset->getName());
}
// NSEC3/NSEC3PARAM is not a "singleton" per protocol, but this
- // implementation doesn't request it be so at the moment.
+ // implementation requests it be so at the moment.
if ((rrset->getType() == RRType::NSEC3() ||
rrset->getType() == RRType::NSEC3PARAM()) &&
rrset->getRdataCount() > 1) {
@@ -298,15 +298,6 @@ struct InMemoryZoneFinder::InMemoryZoneFinderImpl {
}
}
- // A helper functor to convert the 1st NSEC3 label to all upper-cased
- // characters. Note: technically there's a subtle issue when char
- // is signed, but in practice the label should consist of all positive
- // character values for a valid NSEC3 hash name (if it's invalid the
- // resulting zone doesn't work correctly anyway).
- struct ToUpper {
- char operator()(char ch) { return (toupper(ch)); }
- };
-
result::Result addRRsig(const ConstRRsetPtr sig_rrset, ZoneData& zone_data)
{
// Check consistency of the type covered.
@@ -341,10 +332,17 @@ struct InMemoryZoneFinder::InMemoryZoneFinderImpl {
// In case of NSEC3 if something is found it must be NSEC3 RRset
// under the assumption of our current implementation.
if (zone_data.nsec3_data_) {
- string fst_label = sig_rrset->getName().split(0, 1).
- toText(true);
+ // Convert the first label to upper-cased text. Note that
+ // for a valid NSEC3 RR the label should only consist of
+ // positive 8-bit char values, so using toupper(int) should be
+ // safe (if it's a bogus label for NSEC3 the zone won't work
+ // anyway). Also note the '::' below: g++'s STL implementation
+ // seems to require it to toupper to make this compile.
+ string fst_label =
+ sig_rrset->getName().split(0, 1).toText(true);
transform(fst_label.begin(), fst_label.end(),
- fst_label.begin(), ToUpper());
+ fst_label.begin(), ::toupper);
+
NSEC3Map::const_iterator found =
zone_data.nsec3_data_->map_.find(fst_label);
if (found != zone_data.nsec3_data_->map_.end()) {
@@ -386,7 +384,7 @@ struct InMemoryZoneFinder::InMemoryZoneFinderImpl {
dynamic_cast<const generic::NSEC3&>(
rrset->getRdataIterator()->getCurrent());
- // If we've not done any NSEC3 setup for the zone, do it know;
+ // If we've not done any NSEC3 setup for the zone, do it now;
// otherwise check parameter consistency.
if (!zone_data.nsec3_data_) {
zone_data.nsec3_data_.reset(new ZoneData::NSEC3Data(nsec3_rdata));
@@ -397,7 +395,7 @@ struct InMemoryZoneFinder::InMemoryZoneFinderImpl {
string fst_label = rrset->getName().split(0, 1).toText(true);
transform(fst_label.begin(), fst_label.end(), fst_label.begin(),
- ToUpper());
+ ::toupper);
// Our current implementation doesn't allow an existing NSEC3 to be
// updated/overridden.
@@ -927,7 +925,10 @@ InMemoryZoneFinder::load(const string& filename) {
// If the zone is NSEC3-signed, check if it has NSEC3PARAM
if (tmp->nsec3_data_) {
- assert(!tmp->origin_data_->isEmpty());
+ // Note: origin_data_ is set on creation of ZoneData, and the load
+ // process only adds new nodes (and their data), so this assertion
+ // should hold.
+ assert(tmp->origin_data_ != NULL && !tmp->origin_data_->isEmpty());
if (tmp->origin_data_->getData()->find(RRType::NSEC3PARAM()) ==
tmp->origin_data_->getData()->end()) {
LOG_WARN(logger, DATASRC_MEM_NO_NSEC3PARAM).
diff --git a/src/lib/dns/python/tests/nsec3hash_python_test.py b/src/lib/dns/python/tests/nsec3hash_python_test.py
index 3c9329e..1a247d0 100644
--- a/src/lib/dns/python/tests/nsec3hash_python_test.py
+++ b/src/lib/dns/python/tests/nsec3hash_python_test.py
@@ -104,7 +104,7 @@ class NSEC3HashTest(unittest.TestCase):
# Salt doesn't match: the other has an empty salt
self.assertFalse(hash.match(Rdata(rrtype, RRClass.IN(),
"1 0 12 -" + postfix)))
- # Flags doesn't matter
+ # Flag doesn't matter
self.assertTrue(hash.match(Rdata(rrtype, RRClass.IN(),
"1 1 12 aabbccdd" + postfix)))
diff --git a/src/lib/dns/tests/nsec3hash_unittest.cc b/src/lib/dns/tests/nsec3hash_unittest.cc
index 4bd46fa..36a1d4d 100644
--- a/src/lib/dns/tests/nsec3hash_unittest.cc
+++ b/src/lib/dns/tests/nsec3hash_unittest.cc
@@ -115,7 +115,7 @@ matchCheck(NSEC3Hash& hash, const string& postfix) {
EXPECT_FALSE(hash.match(RDATAType("1 0 12 aabbccde" + postfix)));
// Salt doesn't match: the other has an empty salt
EXPECT_FALSE(hash.match(RDATAType("1 0 12 -" + postfix)));
- // Flags doesn't matter
+ // Flags don't matter
EXPECT_TRUE(hash.match(RDATAType("1 1 12 aabbccdd" + postfix)));
}
More information about the bind10-changes
mailing list