]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[5307] Addressed review comments.
authorMarcin Siodelski <marcin@isc.org>
Mon, 25 Sep 2017 10:44:45 +0000 (12:44 +0200)
committerMarcin Siodelski <marcin@isc.org>
Mon, 25 Sep 2017 10:44:45 +0000 (12:44 +0200)
- Increase total_attempts one by one.
- Add debug message to indicate skipping reservations in subnet
  which classes do not match.

src/lib/dhcpsrv/alloc_engine.cc
src/lib/dhcpsrv/alloc_engine_messages.mes

index 95049a131dcda67c2e47cb7cd5f24fca513524ff..d4f0141f9a93ef1d9551b2650d6652f4610a65b1 100644 (file)
@@ -333,6 +333,13 @@ AllocEngine::findReservationInternal(ContextType& ctx,
                     break;
                 }
             }
+
+        } else {
+            LOG_DEBUG(alloc_engine_logger, ALLOC_ENGINE_DBG_TRACE,
+                      ALLOC_ENGINE_RESERVATIONS_SKIPPED)
+                .arg(ctx.query_->getLabel())
+                .arg(subnet->toText());
+
         }
 
         // We need to get to the next subnet if this is a shared network. If it
@@ -771,9 +778,10 @@ AllocEngine::allocateUnreservedLeases6(ClientContext6& ctx) {
         uint64_t max_attempts = (attempts_ > 0 ? attempts_  :
                                  subnet->getPoolCapacity(ctx.currentIA().type_));
 
-        total_attempts += max_attempts;
-
         for (uint64_t i = 0; i < max_attempts; ++i) {
+
+            ++total_attempts;
+
             IOAddress candidate = allocator->pickAddress(subnet, ctx.duid_,
                                                          hint);
 
index 43c137a18af453dc9c495e6c3795cf42bcf3d93f..824bf98742f07cfb24a1fa2ad78e4bf97cb1c9c2 100644 (file)
@@ -18,6 +18,12 @@ reclaimed has a corresponding DNS entry it needs to be removed.
 This message indicates that removal of the DNS entry has failed.
 Nevertheless the lease will be reclaimed.
 
+% ALLOC_ENGINE_RESERVATIONS_SKIPPED %1 not using reservations in subnet %2 because client's classes do not match
+This debug message is issued when the allocation engine will not use host
+reservations in a given subnet because this subnet is not allowed for
+the given client due to client classification. The first argument includes
+client identification information. The second argument identifies a subnet.
+
 % ALLOC_ENGINE_V4_ALLOC_ERROR %1: error during attempt to allocate an IPv4 address: %2
 An error occurred during an attempt to allocate an IPv4 address, the
 reason for the failure being contained in the message.  The server will