BIND 10 master, updated. d4ab440d337cb9ef3f1301c3b655ed0a913cf257 Merge branch 'work/resolveriterator'

BIND 10 source code commits bind10-changes at lists.isc.org
Tue Apr 26 09:41:50 UTC 2011


The branch, master has been updated
       via  d4ab440d337cb9ef3f1301c3b655ed0a913cf257 (commit)
       via  33eb030ea0a6f980573c9a7ffff41c99535df98e (commit)
       via  0194e3a376aa9c1ec2c232b0f2fd9a6cf02e448d (commit)
       via  e5cae846407b0f627ea67ba687132c141c4de57b (commit)
      from  241c11e7b06b233585b52df53a9273ab8e0ad405 (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 d4ab440d337cb9ef3f1301c3b655ed0a913cf257
Merge: 241c11e7b06b233585b52df53a9273ab8e0ad405 33eb030ea0a6f980573c9a7ffff41c99535df98e
Author: Michal 'vorner' Vaner <michal.vaner at nic.cz>
Date:   Tue Apr 26 11:36:31 2011 +0200

    Merge branch 'work/resolveriterator'

commit 33eb030ea0a6f980573c9a7ffff41c99535df98e
Author: Michal 'vorner' Vaner <michal.vaner at nic.cz>
Date:   Tue Apr 26 11:23:47 2011 +0200

    [trac847] Use positive name of variable

commit 0194e3a376aa9c1ec2c232b0f2fd9a6cf02e448d
Author: Michal 'vorner' Vaner <michal.vaner at nic.cz>
Date:   Mon Apr 25 20:35:34 2011 +0200

    [trac847] Don't increment invalid iterator
    
    The problem was, it was increased after invalidating once before
    checking the condition again. It is probably harmless, but according to
    the letter not legal.

-----------------------------------------------------------------------

Summary of changes:
 src/bin/resolver/response_scrubber.cc |   17 +++++++++--------
 src/lib/dns/messagerenderer.cc        |    5 +++--
 2 files changed, 12 insertions(+), 10 deletions(-)

-----------------------------------------------------------------------
diff --git a/src/bin/resolver/response_scrubber.cc b/src/bin/resolver/response_scrubber.cc
index 25dac7c..e890a67 100644
--- a/src/bin/resolver/response_scrubber.cc
+++ b/src/bin/resolver/response_scrubber.cc
@@ -1,4 +1,3 @@
-
 // Copyright (C) 2011  Internet Systems Consortium, Inc. ("ISC")
 //
 // Permission to use, copy, modify, and/or distribute this software for any
@@ -50,7 +49,7 @@ ResponseScrubber::Category ResponseScrubber::addressCheck(
 unsigned int
 ResponseScrubber::scrubSection(Message& message,
     const vector<const Name*>& names,
-    const NameComparisonResult::NameRelation connection, 
+    const NameComparisonResult::NameRelation connection,
     const Message::Section section)
 {
     unsigned int count = 0;     // Count of RRsets removed
@@ -74,30 +73,32 @@ ResponseScrubber::scrubSection(Message& message,
 
         // Start looking at the remaining entries in the section.
         removed = false;
-        for (; (i != message.endSection(section)) && (!removed); ++i) {
+        for (; i != message.endSection(section); ++i) {
 
             // Loop through the list of names given and see if any are in the
             // given relationship with the QNAME of this RRset
-            bool nomatch = true;
+            bool match = false;
             for (vector<const Name*>::const_iterator n = names.begin();
-                ((n != names.end()) && nomatch); ++n) {
+                ((n != names.end())); ++n) {
                 NameComparisonResult result = (*i)->getName().compare(**n);
                 NameComparisonResult::NameRelation relationship =
                     result.getRelation();
                 if ((relationship == NameComparisonResult::EQUAL) ||
                    (relationship == connection)) {
-                    
+
                     // RRset in the specified relationship, so a match has
                     // been found
-                    nomatch = false;
+                    match = true;
+                    break;
                 }
             }
 
             // Remove the RRset if there was no match to one of the given names.
-            if (nomatch) {
+            if (!match) {
                 message.removeRRset(section, i);
                 ++count;            // One more RRset removed
                 removed = true;     // Something was removed
+                break; // It invalidated the iterators, start again
              } else {
 
                 // There was a match so this is one more entry we can skip next
diff --git a/src/lib/dns/messagerenderer.cc b/src/lib/dns/messagerenderer.cc
index 6438fb0..767aca9 100644
--- a/src/lib/dns/messagerenderer.cc
+++ b/src/lib/dns/messagerenderer.cc
@@ -228,8 +228,9 @@ MessageRenderer::writeName(const Name& name, const bool compress) {
     name.toWire(impl_->nbuffer_);
 
     unsigned int i;
-    std::set<NameCompressNode>::const_iterator notfound = impl_->nodeset_.end();
-    std::set<NameCompressNode>::const_iterator n = notfound;
+    std::set<NameCompressNode, NameCompare>::const_iterator notfound =
+        impl_->nodeset_.end();
+    std::set<NameCompressNode, NameCompare>::const_iterator n = notfound;
 
     // Find the longest ancestor name in the rendered set that matches the
     // given name.




More information about the bind10-changes mailing list