]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[#2395] Make ALLOC_ENGINE_V6_ALLOC_FAIL_SUBNET log message format consistent with V4
authorDan Theisen <djt@isc.org>
Mon, 6 Jun 2022 23:59:40 +0000 (16:59 -0700)
committerDan Theisen <djt@isc.org>
Mon, 13 Jun 2022 15:57:28 +0000 (15:57 +0000)
ChangeLog
src/lib/dhcpsrv/alloc_engine.cc
src/lib/dhcpsrv/alloc_engine_messages.mes

index 1c66cef8901da57d5e1692be9cbe9eb7e812aa19..2f69c5b94d17bf43c03b171c25ea953d82d57428 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -14,7 +14,9 @@ Kea 2.1.6 (development) released on May 25 2022
        not within a shared network, it emits "(none)" for the value of the
        shared network. The ARM documentation for this parameter has been
        updated to reflect that subnets within shared networks will in fact
-       display which shared network the subnet belongs to.
+       display which shared network the subnet belongs to. The
+       ALLOC_ENGINE_V6_ALLOC_FAIL_SUBNET log message format has changed to
+       be consistent with the format of ALLOC_ENGINE_V4_ALLOC_FAIL_SUBNET.
 
 2022.  [func]          andrei, djt
        kea-admin lease-upload now calls the lease file cleanup (LFC)
index 10958d64823a3f10b3e1d0da570c52a53d2817c4..7070b53d10ed8280b03637121cfb7b25caa6a2d7 100644 (file)
@@ -1228,9 +1228,15 @@ AllocEngine::allocateUnreservedLeases6(ClientContext6& ctx) {
     } else {
         // The client is not connected to a shared network. It is connected
         // to a subnet. Let's log the ID of that subnet.
+        std::string shared_network = ctx.subnet_->getSharedNetworkName();
+        if (shared_network.empty()) {
+            shared_network = "(none)";
+        }
         LOG_WARN(alloc_engine_logger, ALLOC_ENGINE_V6_ALLOC_FAIL_SUBNET)
             .arg(ctx.query_->getLabel())
-            .arg(ctx.subnet_->getID());
+            .arg(ctx.subnet_->toText())
+            .arg(ctx.subnet_->getID())
+            .arg(shared_network);
         StatsMgr::instance().addValue("v6-allocation-fail-subnet",
                                       static_cast<int64_t>(1));
         StatsMgr::instance().addValue(
index 0eb16779fc7b0d2d9caa10bcfb0edafe4bd8a06a..4ae4b97a68a1499bd388580d1d69bc610ce15c29 100644 (file)
@@ -96,12 +96,11 @@ the subnet. The fourth argument specifies the shared network, if the subnet
 belongs to a shared network.
 
 There are many reasons for failing lease allocations. One of them may be the
-address pools exhaustion or existing reservations for the free leases.
-However, in some cases, the allocation engine may fail to find a suitable
-pool for the client when the pools are only available to certain client
-classes, but the requesting client does not belong to them. Further log
-messages provide more information to distinguish between these different
-cases.
+pools exhaustion or existing reservations for the free leases. However, in
+some cases, the allocation engine may fail to find a suitable pool for the
+client when the pools are only available to certain client classes, but the
+requesting client does not belong to them. Further log messages provide more
+information to distinguish between these different cases.
 
 % ALLOC_ENGINE_V4_DECLINED_RECOVERED IPv4 address %1 was recovered after %2 seconds of probation-period
 This informational message indicates that the specified address was reported
@@ -346,11 +345,12 @@ an operator can identify the situations when there are no leases left
 in some of the pools. He or she can also identify client classification
 misconfigurations causing some clients to be refused the service.
 
-% ALLOC_ENGINE_V6_ALLOC_FAIL_SUBNET %1: failed to allocate an IPv6 lease in the subnet with id %2
+% ALLOC_ENGINE_V6_ALLOC_FAIL_SUBNET %1: failed to allocate an IPv6 address in the subnet %2, subnet-id %3, shared network %4
 This warning message is issued when the allocation engine fails to allocate
-a lease for a client connected to a subnet that does not belong to a shared
-network. The first argument includes the client identification information.
-The second argument specifies the subnet identifier.
+a lease for a client connected to a subnet. The first argument includes the
+client identification information. The second and third arguments identify
+the subnet. The fourth argument specifies the shared network, if the subnet
+belongs to a shared network.
 
 There are many reasons for failing lease allocations. One of them may be the
 pools exhaustion or existing reservations for the free leases. However, in