]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[#2820] add tid in some alloc-engine logs
authorPiotrek Zadroga <piotrek@isc.org>
Mon, 22 Apr 2024 15:58:32 +0000 (17:58 +0200)
committerPiotrek Zadroga <piotrek@isc.org>
Fri, 26 Apr 2024 12:42:46 +0000 (14:42 +0200)
src/lib/dhcpsrv/alloc_engine.cc
src/lib/dhcpsrv/alloc_engine_messages.cc
src/lib/dhcpsrv/alloc_engine_messages.mes

index f963df97f42df92e3653547f246522760361593e..38d47d93126799cb34b74ef2dee40f9a637385e1 100644 (file)
@@ -1390,6 +1390,7 @@ AllocEngine::allocateGlobalReservedLeases6(ClientContext6& ctx,
                 if (!valid_subnet) {
                     LOG_DEBUG(alloc_engine_logger, ALLOC_ENGINE_DBG_TRACE,
                               ALLOC_ENGINE_IGNORING_UNSUITABLE_GLOBAL_ADDRESS6)
+                              .arg(ctx.query_->getLabel())
                               .arg(addr.toText())
                               .arg(labelNetworkOrSubnet(ctx.subnet_));
                     continue;
@@ -1499,11 +1500,13 @@ AllocEngine::removeNonmatchingReservedLeases6(ClientContext6& ctx,
             if (hosts.size() == 1) {
                 if (ctx.currentIA().type_ == Lease::TYPE_NA) {
                     LOG_INFO(alloc_engine_logger, ALLOC_ENGINE_V6_REVOKED_ADDR_LEASE)
+                        .arg(ctx.query_->getLabel())
                         .arg(candidate->addr_.toText())
                         .arg(ctx.duid_->toText())
                         .arg(hosts.front()->getIdentifierAsText());
                 } else {
                     LOG_INFO(alloc_engine_logger, ALLOC_ENGINE_V6_REVOKED_PREFIX_LEASE)
+                        .arg(ctx.query_->toText())
                         .arg(candidate->addr_.toText())
                         .arg(static_cast<int>(candidate->prefixlen_))
                         .arg(ctx.duid_->toText())
@@ -1512,11 +1515,13 @@ AllocEngine::removeNonmatchingReservedLeases6(ClientContext6& ctx,
             } else {
                 if (ctx.currentIA().type_ == Lease::TYPE_NA) {
                     LOG_INFO(alloc_engine_logger, ALLOC_ENGINE_V6_REVOKED_SHARED_ADDR_LEASE)
+                        .arg(ctx.query_->getLabel())
                         .arg(candidate->addr_.toText())
                         .arg(ctx.duid_->toText())
                         .arg(hosts.size());
                 } else {
                     LOG_INFO(alloc_engine_logger, ALLOC_ENGINE_V6_REVOKED_SHARED_PREFIX_LEASE)
+                        .arg(ctx.query_->getLabel())
                         .arg(candidate->addr_.toText())
                         .arg(static_cast<int>(candidate->prefixlen_))
                         .arg(ctx.duid_->toText())
@@ -3453,6 +3458,7 @@ hasAddressReservation(AllocEngine::ClientContext4& ctx) {
     if (global_host_address != IOAddress::IPV4_ZERO_ADDRESS()) {
         LOG_DEBUG(alloc_engine_logger, ALLOC_ENGINE_DBG_TRACE,
                   ALLOC_ENGINE_IGNORING_UNSUITABLE_GLOBAL_ADDRESS)
+            .arg(ctx.query_->getLabel())
             .arg(ctx.currentHost()->getIPv4Reservation().toText())
             .arg(AllocEngine::labelNetworkOrSubnet(ctx.subnet_));
     }
index 060dcfe759103e46ac6f8d716302462511d9a9c6..d74155c27ed0e8e8bd237b9b78ff64f22a348c6e 100644 (file)
@@ -93,8 +93,8 @@ extern const isc::log::MessageID ALLOC_ENGINE_V6_REVOKED_SHARED_PREFIX_LEASE = "
 namespace {
 
 const char* values[] = {
-    "ALLOC_ENGINE_IGNORING_UNSUITABLE_GLOBAL_ADDRESS", "ignoring globally reserved address %1, it falls outside %2",
-    "ALLOC_ENGINE_IGNORING_UNSUITABLE_GLOBAL_ADDRESS6", "ignoring globally reserved address %1, it falls outside %2",
+    "ALLOC_ENGINE_IGNORING_UNSUITABLE_GLOBAL_ADDRESS", "%1: ignoring globally reserved address %2, it falls outside %3",
+    "ALLOC_ENGINE_IGNORING_UNSUITABLE_GLOBAL_ADDRESS6", "%1: ignoring globally reserved address %2, it falls outside %3",
     "ALLOC_ENGINE_LEASE_RECLAIMED", "successfully reclaimed lease %1",
     "ALLOC_ENGINE_REMOVAL_NCR_FAILED", "sending removal name change request failed for lease %1: %2",
     "ALLOC_ENGINE_V4_ALLOC_ERROR", "%1: error during attempt to allocate an IPv4 address: %2",
@@ -168,10 +168,10 @@ const char* values[] = {
     "ALLOC_ENGINE_V6_RENEW_REMOVE_RESERVED", "%1: checking if existing client's leases are reserved for another client",
     "ALLOC_ENGINE_V6_RENEW_REMOVE_UNRESERVED", "dynamically allocating leases for the renewing client %1",
     "ALLOC_ENGINE_V6_REUSE_EXPIRED_LEASE_DATA", "%1: reusing expired lease, updated lease information: %2",
-    "ALLOC_ENGINE_V6_REVOKED_ADDR_LEASE", "address %1 was revoked from client %2 as it is reserved for client %3",
-    "ALLOC_ENGINE_V6_REVOKED_PREFIX_LEASE", "prefix %1/%2 was revoked from client %3 as it is reserved for client %4",
-    "ALLOC_ENGINE_V6_REVOKED_SHARED_ADDR_LEASE", "address %1 was revoked from client %2 as it is reserved for %3 other clients",
-    "ALLOC_ENGINE_V6_REVOKED_SHARED_PREFIX_LEASE", "prefix %1/%2 was revoked from client %3 as it is reserved for %4 other clients",
+    "ALLOC_ENGINE_V6_REVOKED_ADDR_LEASE", "%1: address %2 was revoked from client %3 as it is reserved for client %4",
+    "ALLOC_ENGINE_V6_REVOKED_PREFIX_LEASE", "%1: prefix %2/%3 was revoked from client %4 as it is reserved for client %5",
+    "ALLOC_ENGINE_V6_REVOKED_SHARED_ADDR_LEASE", "%1: address %2 was revoked from client %3 as it is reserved for %4 other clients",
+    "ALLOC_ENGINE_V6_REVOKED_SHARED_PREFIX_LEASE", "%1: prefix %2/%3 was revoked from client %4 as it is reserved for %5 other clients",
     NULL
 };
 
index f6a50a2ec9e95808719d401785d1ed752f494495..c777b27c8c87ed8d205874877edbdc91b450ef5f 100644 (file)
@@ -6,13 +6,13 @@
 
 $NAMESPACE isc::dhcp
 
-% ALLOC_ENGINE_IGNORING_UNSUITABLE_GLOBAL_ADDRESS ignoring globally reserved address %1, it falls outside %2
+% ALLOC_ENGINE_IGNORING_UNSUITABLE_GLOBAL_ADDRESS %1: ignoring globally reserved address %2, it falls outside %3
 This debug message is issued when the allocation engine determines that
 the globally reserved address falls outside the selected subnet or
 shared-network.  The server should ignore the reserved address and
 attempt a dynamic allocation.
 
-% ALLOC_ENGINE_IGNORING_UNSUITABLE_GLOBAL_ADDRESS6 ignoring globally reserved address %1, it falls outside %2
+% ALLOC_ENGINE_IGNORING_UNSUITABLE_GLOBAL_ADDRESS6 %1: ignoring globally reserved address %2, it falls outside %3
 This debug message is issued when the allocation engine determines that
 the globally reserved address falls outside the selected subnet or
 shared-network.  The server should ignore the reserved address and
@@ -588,7 +588,7 @@ an existing lease. The details of the updated lease are
 printed. The first argument includes the client identification
 information.
 
-% ALLOC_ENGINE_V6_REVOKED_ADDR_LEASE address %1 was revoked from client %2 as it is reserved for client %3
+% ALLOC_ENGINE_V6_REVOKED_ADDR_LEASE %1: address %2 was revoked from client %3 as it is reserved for client %4
 This informational message is an indication that the specified IPv6
 address was used by client A but it is now reserved for client B. Client
 A has been told to stop using it so that it can be leased to client B.
@@ -597,7 +597,7 @@ in cases such as the system administrator adding a reservation for an
 address that is currently in use by another client.  The server will fully
 recover from this situation, but clients will change their addresses.
 
-% ALLOC_ENGINE_V6_REVOKED_PREFIX_LEASE prefix %1/%2 was revoked from client %3 as it is reserved for client %4
+% ALLOC_ENGINE_V6_REVOKED_PREFIX_LEASE %1: prefix %2/%3 was revoked from client %4 as it is reserved for client %5
 This informational message is an indication that the specified IPv6
 prefix was used by client A but it is now reserved for client B. Client
 A has been told to stop using it so that it can be leased to client B.
@@ -606,7 +606,7 @@ in cases such as the system administrator adding a reservation for an
 address that is currently in use by another client.  The server will fully
 recover from this situation, but clients will change their prefixes.
 
-% ALLOC_ENGINE_V6_REVOKED_SHARED_ADDR_LEASE address %1 was revoked from client %2 as it is reserved for %3 other clients
+% ALLOC_ENGINE_V6_REVOKED_SHARED_ADDR_LEASE %1: address %2 was revoked from client %3 as it is reserved for %4 other clients
 This informational message is an indication that the specified IPv6
 address was used by client A but it is now reserved for multiple other
 clients. Client A has been told to stop using it so that it can be
@@ -616,7 +616,7 @@ such as the system administrator adding reservations for an address
 that is currently in use by another client.  The server will fully
 recover from this situation, but clients will change their addresses.
 
-% ALLOC_ENGINE_V6_REVOKED_SHARED_PREFIX_LEASE prefix %1/%2 was revoked from client %3 as it is reserved for %4 other clients
+% ALLOC_ENGINE_V6_REVOKED_SHARED_PREFIX_LEASE %1: prefix %2/%3 was revoked from client %4 as it is reserved for %5 other clients
 This informational message is an indication that the specified IPv6
 prefix was used by client A but it is now reserved for multiple other
 clients. Client A has been told to stop using it so that it can be