[svn] commit: r3534 - /branches/trac397/src/bin/auth/rbt_datasrc.h

BIND 10 source code commits bind10-changes at lists.isc.org
Tue Nov 16 12:59:20 UTC 2010


Author: hanfeng
Date: Tue Nov 16 12:59:20 2010
New Revision: 3534

Log:
fix bug for finding that for intermediate node return not found becuase this kind of node is opaque for end user

Modified:
    branches/trac397/src/bin/auth/rbt_datasrc.h

Modified: branches/trac397/src/bin/auth/rbt_datasrc.h
==============================================================================
--- branches/trac397/src/bin/auth/rbt_datasrc.h (original)
+++ branches/trac397/src/bin/auth/rbt_datasrc.h Tue Nov 16 12:59:20 2010
@@ -126,7 +126,8 @@
     color_(RED),
     name_(name),
     data_(data),
-    down_(NULL) {
+    down_(NULL),
+    is_shadow_(false){
 }
 
 template <typename T>
@@ -136,7 +137,8 @@
     right_(nullnode),
     color_(RED),
     name_(name),
-    down_(NULL) {
+    down_(NULL),
+    is_shadow_(false){
 }
 
 template <typename T>
@@ -173,6 +175,7 @@
 RBNode<T>::cloneDNSData(RBNode<T>& node) {
     node.name_ = name_;
     node.data_ = data_;
+    node.is_shadow_ = is_shadow_;
 }
 
 template <typename T>
@@ -354,9 +357,13 @@
         NameComparisonResult::NameRelation relation =
             compare_result.getRelation();
         if (relation == NameComparisonResult::EQUAL) {
-            *tree = (RBTree*)this;
-            *ret = node;
-            return (RBTree<T>::EXACTMATCH);
+            if (node->is_shadow_) {
+                return (RBTree<T>::NOTFOUND);
+            } else {
+                *tree = (RBTree*)this;
+                *ret = node;
+                return (RBTree<T>::EXACTMATCH);
+            }
         } else {
             int common_label_count = compare_result.getCommonLabels();
             // common label count equal one means, there is no common between




More information about the bind10-changes mailing list