From: Tomek Mrugalski Date: Fri, 19 Dec 2014 13:19:20 +0000 (+0100) Subject: [3564] Compilation fix. X-Git-Tag: trac3504_base~25^2~2 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=b448b5cbd2f380dc60428cc9c494ba57da04c9bc;p=thirdparty%2Fkea.git [3564] Compilation fix. --- diff --git a/src/lib/dhcpsrv/alloc_engine.cc b/src/lib/dhcpsrv/alloc_engine.cc index ea8ff2b16d..56af869a54 100644 --- a/src/lib/dhcpsrv/alloc_engine.cc +++ b/src/lib/dhcpsrv/alloc_engine.cc @@ -996,6 +996,7 @@ AllocEngine::replaceClientLease(Lease4Ptr& lease, Context4& ctx) { updateLease4Information(lease, ctx); + bool skip = false; // Execute callouts registered for lease4_select. if (ctx.callout_handle_ && HooksManager::getHooksManager() .calloutsPresent(hook_index_lease4_select_)) { @@ -1023,6 +1024,15 @@ AllocEngine::replaceClientLease(Lease4Ptr& lease, Context4& ctx) { // Let's use whatever callout returned. ctx.callout_handle_->getArgument("lease4", lease); + + // Callouts decided to skip the next processing step. The next + // processing step would to actually renew the lease, so skip at this + // stage means "keep the old lease as it is". + if (ctx.callout_handle_->getSkip()) { + skip = true; + LOG_DEBUG(dhcpsrv_logger, DHCPSRV_DBG_HOOKS, + DHCPSRV_HOOK_LEASE4_SELECT_SKIP); + } } /// @todo There should be a callout for a deletion of an old lease.