// Collect host identifiers if host reservations enabled. The identifiers
// are stored in order of preference. The server will use them in that
// order to search for host reservations.
- if (ctx.subnet_ &&
- (ctx.subnet_->getHostReservationMode() != Network::HR_DISABLED)) {
+ if (ctx.subnet_) {
const ConstCfgHostOperationsPtr cfg =
CfgMgr::instance().getCurrentCfg()->getCfgHostOperations6();
BOOST_FOREACH(const Host::IdentifierType& id_type,
while (subnet) {
// Only makes sense to get reservations if the client has access
- // to the class.
- if (subnet->clientSupported(ctx.query_->getClasses())) {
+ // to the class and host reservations are enabled.
+ if (subnet->clientSupported(ctx.query_->getClasses()) &&
+ (subnet->getHostReservationMode() != Network::HR_DISABLED)) {
// Iterate over configured identifiers in the order of preference
// and try to use each of them to search for the reservations.
BOOST_FOREACH(const IdentifierPair& id_pair, ctx.host_identifiers_) {
<< Lease6::typeToText(ctx.currentIA().type_));
}
- // Check which host reservation mode is supported in this subnet.
- Network::HRMode hr_mode = ctx.subnet_->getHostReservationMode();
-
Lease6Collection leases;
IOAddress hint = IOAddress::IPV6_ZERO_ADDRESS();
if (pool) {
+ // Check which host reservation mode is supported in this subnet.
+ Network::HRMode hr_mode = subnet->getHostReservationMode();
+
/// @todo: We support only one hint for now
Lease6Ptr lease =
LeaseMgrFactory::instance().getLease6(ctx.currentIA().type_, hint);
}
uint64_t max_attempts = (attempts_ > 0 ? attempts_ : possible_attempts);
+ Network::HRMode hr_mode = subnet->getHostReservationMode();
+
for (uint64_t i = 0; i < max_attempts; ++i) {
++total_attempts;