2
0
mirror of https://gitlab.isc.org/isc-projects/kea synced 2025-08-31 05:55:28 +00:00

[#1405] addressed comments

This commit is contained in:
Razvan Becheriu
2020-11-17 13:05:38 +02:00
parent 1460c7ec66
commit 506051bc6c

View File

@@ -2965,14 +2965,11 @@ namespace {
/// @return true if the address is reserved for another client.
bool
addressReserved(const IOAddress& address, const AllocEngine::ClientContext4& ctx) {
if (!ctx.subnet_) {
return false;
}
bool in_subnet = ctx.subnet_->getReservationsInSubnet();
// The out-of-pool flag indicates that no client should be assigned reservations
// from within the dynamic pool, and for that reason we only look at reservations that
// are outside the pools, hence the inPool check.
if (in_subnet && (!ctx.subnet_->getReservationsOutOfPool() ||
if (ctx.subnet_ && ctx.subnet_->getReservationsInSubnet() &&
(!ctx.subnet_->getReservationsOutOfPool() ||
!ctx.subnet_->inPool(Lease::TYPE_V4, address))) {
// The global parameter ip-reservations-unique controls whether it is allowed
// to specify multiple reservations for the same IP address or delegated prefix