Commit 8659d981 authored by Han Feng's avatar Han Feng
Browse files

fix bug for finding that for intermediate node return not found becuase this...

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

git-svn-id: svn://bind10.isc.org/svn/bind10/branches/trac397@3534 e5f2f494-b856-4b98-b285-d166d9295462
parent 3210721b
......@@ -126,7 +126,8 @@ RBNode<T>::RBNode(const Name& name, T &data, RBNode* nullnode) :
color_(RED),
name_(name),
data_(data),
down_(NULL) {
down_(NULL),
is_shadow_(false){
}
template <typename T>
......@@ -136,7 +137,8 @@ RBNode<T>::RBNode(const Name& name, RBNode* nullnode) :
right_(nullnode),
color_(RED),
name_(name),
down_(NULL) {
down_(NULL),
is_shadow_(false){
}
template <typename T>
......@@ -173,6 +175,7 @@ void
RBNode<T>::cloneDNSData(RBNode<T>& node) {
node.name_ = name_;
node.data_ = data_;
node.is_shadow_ = is_shadow_;
}
template <typename T>
......@@ -354,9 +357,13 @@ RBTree<T>::findHelper(const Name& name, RBTree<T>** tree, RBNode<T>** ret) const
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
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment