]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[3564] Compilation fix.
authorTomek Mrugalski <tomasz@isc.org>
Fri, 19 Dec 2014 13:19:20 +0000 (14:19 +0100)
committerTomek Mrugalski <tomasz@isc.org>
Fri, 19 Dec 2014 13:19:20 +0000 (14:19 +0100)
src/lib/dhcpsrv/alloc_engine.cc

index ea8ff2b16d65c2e43cdccae7e9607265c489be44..56af869a54e1ca9d6f72329f3d069365cbf7e285 100644 (file)
@@ -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.