From: Dan Theisen Date: Mon, 6 Jun 2022 23:59:40 +0000 (-0700) Subject: [#2395] Make ALLOC_ENGINE_V6_ALLOC_FAIL_SUBNET log message format consistent with V4 X-Git-Tag: Kea-2.1.7~136 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=040363cbee739b5662764fa0720f150d337bb7f3;p=thirdparty%2Fkea.git [#2395] Make ALLOC_ENGINE_V6_ALLOC_FAIL_SUBNET log message format consistent with V4 --- diff --git a/ChangeLog b/ChangeLog index 1c66cef890..2f69c5b94d 100644 --- 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) diff --git a/src/lib/dhcpsrv/alloc_engine.cc b/src/lib/dhcpsrv/alloc_engine.cc index 10958d6482..7070b53d10 100644 --- a/src/lib/dhcpsrv/alloc_engine.cc +++ b/src/lib/dhcpsrv/alloc_engine.cc @@ -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(1)); StatsMgr::instance().addValue( diff --git a/src/lib/dhcpsrv/alloc_engine_messages.mes b/src/lib/dhcpsrv/alloc_engine_messages.mes index 0eb16779fc..4ae4b97a68 100644 --- a/src/lib/dhcpsrv/alloc_engine_messages.mes +++ b/src/lib/dhcpsrv/alloc_engine_messages.mes @@ -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