Lease6StorageSubnetIdIndex::const_iterator lb =
idx.lower_bound(boost::make_tuple(subnet_id, lower_bound_address));
+ // Exclude the lower bound address specified by the caller.
+ if ((lb != idx.end()) && ((*lb)->addr_ == lower_bound_address)) {
+ ++lb;
+ }
+
// Return all leases being within the page size.
- IOAddress last_addr = lower_bound_address;
for (auto it = lb; it != idx.end(); ++it) {
- if ((*it)->addr_ == last_addr) {
- // Already seen: skip it.
- continue;
- }
if ((*it)->subnet_id_ != subnet_id) {
// Gone after the subnet id index.
break;
}
- last_addr = (*it)->addr_;
collection.push_back(Lease6Ptr(new Lease6(**it)));
if (collection.size() >= page_size.page_size_) {
break;
getLeases6(const asiolink::IOAddress& lower_bound_address,
const LeasePageSize& page_size) const override;
- /// @brief Returns a page of IPv6 leases for a subnet identifier.
+ /// @brief Returns a page of IPv6 leases for a subnet identifier.
///
/// @param subnet_id subnet identifier.
/// @param lower_bound_address IPv6 address used as lower bound for the
const LeasePageSize& page_size,
Lease6Collection& collection) const;
- /// @brief Returns a page of IPv6 leases for a subnet identifier.
+ /// @brief Returns a page of IPv6 leases for a subnet identifier.
///
/// @param subnet_id subnet identifier.
/// @param lower_bound_address IPv6 address used as lower bound for the
// Specification of the fourth index starts here.
// This index sorts leases by SubnetID and address.
- boost::multi_index::ordered_non_unique<
+ boost::multi_index::ordered_unique<
boost::multi_index::tag<SubnetIdIndexTag>,
boost::multi_index::composite_key<
Lease6,