2
0
mirror of https://gitlab.isc.org/isc-projects/kea synced 2025-09-02 06:55:16 +00:00

[#1040] handle update and delete

This commit is contained in:
Razvan Becheriu
2020-01-23 19:17:53 +02:00
parent 735fdcb6eb
commit 364bbbf3d4
7 changed files with 115 additions and 51 deletions

View File

@@ -3043,6 +3043,15 @@ Dhcpv4Srv::declineLease(const Lease4Ptr& lease, const Pkt4Ptr& decline,
// queueNCR will do the necessary checks and will skip the update, if not needed.
queueNCR(CHG_REMOVE, lease);
// @todo: Call hooks.
// We need to disassociate the lease from the client. Once we move a lease
// to declined state, it is no longer associated with the client in any
// way.
lease->decline(CfgMgr::instance().getCurrentCfg()->getDeclinePeriod());
LeaseMgrFactory::instance().updateLease4(lease);
// Bump up the statistics.
// Per subnet declined addresses counter.
@@ -3062,15 +3071,6 @@ Dhcpv4Srv::declineLease(const Lease4Ptr& lease, const Pkt4Ptr& decline,
// immediately after receiving DHCPDECLINE, rather than later when we recover
// the address.
// @todo: Call hooks.
// We need to disassociate the lease from the client. Once we move a lease
// to declined state, it is no longer associated with the client in any
// way.
lease->decline(CfgMgr::instance().getCurrentCfg()->getDeclinePeriod());
LeaseMgrFactory::instance().updateLease4(lease);
context.reset(new AllocEngine::ClientContext4());
context->new_lease_ = lease;