mirror of
https://gitlab.isc.org/isc-projects/kea
synced 2025-08-30 21:45:37 +00:00
[5437] HR_DISABLED option handling moved to subnet level.
This commit is contained in:
@@ -316,8 +316,7 @@ Dhcpv6Srv::initContext(const Pkt6Ptr& pkt,
|
|||||||
// Collect host identifiers if host reservations enabled. The identifiers
|
// Collect host identifiers if host reservations enabled. The identifiers
|
||||||
// are stored in order of preference. The server will use them in that
|
// are stored in order of preference. The server will use them in that
|
||||||
// order to search for host reservations.
|
// order to search for host reservations.
|
||||||
if (ctx.subnet_ &&
|
if (ctx.subnet_) {
|
||||||
(ctx.subnet_->getHostReservationMode() != Network::HR_DISABLED)) {
|
|
||||||
const ConstCfgHostOperationsPtr cfg =
|
const ConstCfgHostOperationsPtr cfg =
|
||||||
CfgMgr::instance().getCurrentCfg()->getCfgHostOperations6();
|
CfgMgr::instance().getCurrentCfg()->getCfgHostOperations6();
|
||||||
BOOST_FOREACH(const Host::IdentifierType& id_type,
|
BOOST_FOREACH(const Host::IdentifierType& id_type,
|
||||||
|
@@ -536,8 +536,9 @@ void AllocEngine::findReservation(ClientContext6& ctx) {
|
|||||||
while (subnet) {
|
while (subnet) {
|
||||||
|
|
||||||
// Only makes sense to get reservations if the client has access
|
// Only makes sense to get reservations if the client has access
|
||||||
// to the class.
|
// to the class and host reservations are enabled.
|
||||||
if (subnet->clientSupported(ctx.query_->getClasses())) {
|
if (subnet->clientSupported(ctx.query_->getClasses()) &&
|
||||||
|
(subnet->getHostReservationMode() != Network::HR_DISABLED)) {
|
||||||
// Iterate over configured identifiers in the order of preference
|
// Iterate over configured identifiers in the order of preference
|
||||||
// and try to use each of them to search for the reservations.
|
// and try to use each of them to search for the reservations.
|
||||||
BOOST_FOREACH(const IdentifierPair& id_pair, ctx.host_identifiers_) {
|
BOOST_FOREACH(const IdentifierPair& id_pair, ctx.host_identifiers_) {
|
||||||
@@ -750,9 +751,6 @@ AllocEngine::allocateUnreservedLeases6(ClientContext6& ctx) {
|
|||||||
<< Lease6::typeToText(ctx.currentIA().type_));
|
<< Lease6::typeToText(ctx.currentIA().type_));
|
||||||
}
|
}
|
||||||
|
|
||||||
// Check which host reservation mode is supported in this subnet.
|
|
||||||
Network::HRMode hr_mode = ctx.subnet_->getHostReservationMode();
|
|
||||||
|
|
||||||
Lease6Collection leases;
|
Lease6Collection leases;
|
||||||
|
|
||||||
IOAddress hint = IOAddress::IPV6_ZERO_ADDRESS();
|
IOAddress hint = IOAddress::IPV6_ZERO_ADDRESS();
|
||||||
@@ -789,6 +787,9 @@ AllocEngine::allocateUnreservedLeases6(ClientContext6& ctx) {
|
|||||||
|
|
||||||
if (pool) {
|
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
|
/// @todo: We support only one hint for now
|
||||||
Lease6Ptr lease =
|
Lease6Ptr lease =
|
||||||
LeaseMgrFactory::instance().getLease6(ctx.currentIA().type_, hint);
|
LeaseMgrFactory::instance().getLease6(ctx.currentIA().type_, hint);
|
||||||
@@ -893,6 +894,8 @@ AllocEngine::allocateUnreservedLeases6(ClientContext6& ctx) {
|
|||||||
}
|
}
|
||||||
uint64_t max_attempts = (attempts_ > 0 ? attempts_ : possible_attempts);
|
uint64_t max_attempts = (attempts_ > 0 ? attempts_ : possible_attempts);
|
||||||
|
|
||||||
|
Network::HRMode hr_mode = subnet->getHostReservationMode();
|
||||||
|
|
||||||
for (uint64_t i = 0; i < max_attempts; ++i) {
|
for (uint64_t i = 0; i < max_attempts; ++i) {
|
||||||
|
|
||||||
++total_attempts;
|
++total_attempts;
|
||||||
|
Reference in New Issue
Block a user