Commit 304dd811 authored by Marcin Siodelski's avatar Marcin Siodelski

[#659,!387] Addressed two review comments.

- Return after finding the first pool.
- Corrected excluded prefix length stored in the db.
parent 5f08d328
......@@ -1047,16 +1047,15 @@ public:
};
getPools(GET_POOL6_RANGE, in_bindings, pools, pool_ids);
// Break if something is found?
}
if (!pools.empty()) {
pool_id = pool_ids[0];
return (boost::dynamic_pointer_cast<Pool6>(*pools.begin()));
// Return upon the first pool found.
if (!pools.empty()) {
pool_id = pool_ids[0];
return (boost::dynamic_pointer_cast<Pool6>(*pools.begin()));
}
}
pool_id = 0;
return (Pool6Ptr());
}
......@@ -1313,7 +1312,7 @@ public:
const Option6PDExcludePtr& xopt = pd_pool->getPrefixExcludeOption();
if (xopt) {
const IOAddress& prefix = pd_pool->getFirstAddress();
const IOAddress& xprefix = xopt->getExcludedPrefix(prefix, plen);
const IOAddress& xprefix = xopt->getExcludedPrefix(prefix, pd_pool->getLength());
xprefix_txt = xprefix.toText();
xlen = xopt->getExcludedPrefixLength();
}
......
......@@ -241,8 +241,10 @@ public:
test_options_[4]->persistent_,
test_options_[4]->space_name_);
pdpool2.reset(new Pool6(Lease::TYPE_PD,
IOAddress("2001:db8:d::"), 48, 64));
// Create the prefix delegation pool with an excluded prefix.
pdpool2.reset(new Pool6(IOAddress("2001:db8:d::"), 48, 64,
IOAddress("2001:db8:d::2000"), 120));
subnet->addPool(pdpool2);
pdpool2->allowClientClass("work");
......
Markdown is supported
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