]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[#4547] Updated the check master
authorFrancis Dupont <fdupont@isc.org>
Thu, 9 Jul 2026 17:19:04 +0000 (19:19 +0200)
committerFrancis Dupont <fdupont@isc.org>
Thu, 9 Jul 2026 17:19:04 +0000 (19:19 +0200)
src/bin/dhcp4/dhcp4_messages.cc
src/bin/dhcp4/dhcp4_messages.h
src/bin/dhcp4/dhcp4_messages.mes
src/bin/dhcp4/dhcp4_srv.cc
src/bin/dhcp4/tests/release_unittest.cc

index cfffda725488d0654e20db328e6df191595e5b07..d78af41d34f67e3bcf437cd6882cc4a5348573b4 100644 (file)
@@ -151,11 +151,11 @@ extern const isc::log::MessageID DHCP4_RECLAIM_EXPIRED_LEASES_FAIL = "DHCP4_RECL
 extern const isc::log::MessageID DHCP4_RECLAIM_EXPIRED_LEASES_SKIPPED = "DHCP4_RECLAIM_EXPIRED_LEASES_SKIPPED";
 extern const isc::log::MessageID DHCP4_RECOVERED_STASHED_RELAY_AGENT_INFO = "DHCP4_RECOVERED_STASHED_RELAY_AGENT_INFO";
 extern const isc::log::MessageID DHCP4_RELEASE = "DHCP4_RELEASE";
-extern const isc::log::MessageID DHCP4_RELEASE_ALREADY_IN_RELEASED_STATE = "DHCP4_RELEASE_ALREADY_IN_RELEASED_STATE";
 extern const isc::log::MessageID DHCP4_RELEASE_DELETED = "DHCP4_RELEASE_DELETED";
 extern const isc::log::MessageID DHCP4_RELEASE_EXCEPTION = "DHCP4_RELEASE_EXCEPTION";
 extern const isc::log::MessageID DHCP4_RELEASE_EXPIRED = "DHCP4_RELEASE_EXPIRED";
 extern const isc::log::MessageID DHCP4_RELEASE_FAIL = "DHCP4_RELEASE_FAIL";
+extern const isc::log::MessageID DHCP4_RELEASE_FAIL_NOT_ASSIGNED = "DHCP4_RELEASE_FAIL_NOT_ASSIGNED";
 extern const isc::log::MessageID DHCP4_RELEASE_FAIL_NO_LEASE = "DHCP4_RELEASE_FAIL_NO_LEASE";
 extern const isc::log::MessageID DHCP4_RELEASE_FAIL_WRONG_CLIENT = "DHCP4_RELEASE_FAIL_WRONG_CLIENT";
 extern const isc::log::MessageID DHCP4_REQUEST = "DHCP4_REQUEST";
@@ -340,11 +340,11 @@ const char* values[] = {
     "DHCP4_RECLAIM_EXPIRED_LEASES_SKIPPED", "dhcp6 service is currently disabled. Try again in %1 seconds.",
     "DHCP4_RECOVERED_STASHED_RELAY_AGENT_INFO", "recovered for query %1 relay agent option from lease %2: %3",
     "DHCP4_RELEASE", "%1: address %2 was released properly.",
-    "DHCP4_RELEASE_ALREADY_IN_RELEASED_STATE", "%1: client is trying to release the lease %2 which is already in the RELEASED state",
     "DHCP4_RELEASE_DELETED", "%1: address %2 was deleted on release.",
     "DHCP4_RELEASE_EXCEPTION", "%1: while trying to release address %2 an exception occurred: %3",
     "DHCP4_RELEASE_EXPIRED", "%1: address %2 expired on release.",
     "DHCP4_RELEASE_FAIL", "%1: failed to remove lease for address %2",
+    "DHCP4_RELEASE_FAIL_NOT_ASSIGNED", "%1: client is trying to release the lease %2 which is in the %3 state",
     "DHCP4_RELEASE_FAIL_NO_LEASE", "%1: client is trying to release non-existing lease %2",
     "DHCP4_RELEASE_FAIL_WRONG_CLIENT", "%1: client is trying to release the lease %2 which belongs to a different client",
     "DHCP4_REQUEST", "%1: server is processing DHCPREQUEST with hint=%2",
index 9e1d9c22931d81c1e0c5ca46313dd2b7b53f11d4..eb1a6195386bba62d592b0da7bbefa7d2d5fe272 100644 (file)
@@ -152,11 +152,11 @@ extern const isc::log::MessageID DHCP4_RECLAIM_EXPIRED_LEASES_FAIL;
 extern const isc::log::MessageID DHCP4_RECLAIM_EXPIRED_LEASES_SKIPPED;
 extern const isc::log::MessageID DHCP4_RECOVERED_STASHED_RELAY_AGENT_INFO;
 extern const isc::log::MessageID DHCP4_RELEASE;
-extern const isc::log::MessageID DHCP4_RELEASE_ALREADY_IN_RELEASED_STATE;
 extern const isc::log::MessageID DHCP4_RELEASE_DELETED;
 extern const isc::log::MessageID DHCP4_RELEASE_EXCEPTION;
 extern const isc::log::MessageID DHCP4_RELEASE_EXPIRED;
 extern const isc::log::MessageID DHCP4_RELEASE_FAIL;
+extern const isc::log::MessageID DHCP4_RELEASE_FAIL_NOT_ASSIGNED;
 extern const isc::log::MessageID DHCP4_RELEASE_FAIL_NO_LEASE;
 extern const isc::log::MessageID DHCP4_RELEASE_FAIL_WRONG_CLIENT;
 extern const isc::log::MessageID DHCP4_REQUEST;
index 7dd7f3c6e059be9bc6ebecf34a390a98d015473b..50afa34ef1103fe12988e2c96ca2f0ebf803955e 100644 (file)
@@ -980,14 +980,6 @@ is a normal operation during client shutdown. The first argument includes
 the client and transaction identification information. The second argument
 includes the released IPv4 address.
 
-% DHCP4_RELEASE_ALREADY_IN_RELEASED_STATE %1: client is trying to release the lease %2 which is already in the RELEASED state
-Logged at debug log level 50.
-This debug message is issued when a client is trying to release the
-lease which is already in the RELEASED state i.e. kept for the client
-by the lease affinity feature. The first argument includes the client
-and the transaction identification information. The second argument
-specifies the leased address.
-
 % DHCP4_RELEASE_DELETED %1: address %2 was deleted on release.
 This informational message indicates that an address was deleted on release. It
 is a normal operation during client shutdown. The first argument includes the
@@ -1022,6 +1014,14 @@ first argument includes the client and the transaction identification
 information. The second argument holds the IPv4 address which release
 was attempted.
 
+% DHCP4_RELEASE_FAIL_NOT_ASSIGNED %1: client is trying to release the lease %2 which is in the %3 state
+Logged at debug log level 50.
+This debug message is issued when a client is trying to release the
+lease which is not in the default / assigned state e.g. kept for the client
+by the lease affinity feature in the released state. The first argument
+includes the client and the transaction identification information.
+The second argument specifies the leased address, the last one the lease state.
+
 % DHCP4_RELEASE_FAIL_NO_LEASE %1: client is trying to release non-existing lease %2
 Logged at debug log level 50.
 This debug message is printed when client attempts to release a lease,
index e0849df7bbefda1b48bc4ef0c4fcf1a74e07c9bf..e2de71c907e187b6bc23e8ac9cca9c17cfebb43d 100644 (file)
@@ -4174,11 +4174,11 @@ Dhcpv4Srv::processRelease(Pkt4Ptr& release, AllocEngine::ClientContext4Ptr& cont
             return;
         }
 
-        if (lease->state_ == Lease4::STATE_RELEASED) {
-            LOG_DEBUG(lease4_logger, DBG_DHCP4_DETAIL,
-                      DHCP4_RELEASE_ALREADY_IN_RELEASED_STATE)
+        if (lease->state_ != Lease4::STATE_DEFAULT) {
+            LOG_DEBUG(lease4_logger, DBG_DHCP4_DETAIL, DHCP4_RELEASE_FAIL_NOT_ASSIGNED)
                 .arg(release->getLabel())
-                .arg(release->getCiaddr().toText());
+                .arg(release->getCiaddr().toText())
+                .arg(Lease::basicStatesToText(lease->state_));
             return;
         }
 
index 251a977679879747d97100bdf416ff819b6498ed..6489cde979453596d79f2f2bbdaf4efabea6e848 100644 (file)
@@ -555,8 +555,8 @@ TEST_F(ReleaseTest, releaseAlreadyReleased) {
     // assigned stat is decremented once.
     EXPECT_EQ(before, after + 1);
 
-    // The alredy in RELEASED state is logged.
-    EXPECT_EQ(1U, countFile("DHCP4_RELEASE_ALREADY_IN_RELEASED_STATE"));
+    // The not assigned failure is logged.
+    EXPECT_EQ(1U, countFile("DHCP4_RELEASE_FAIL_NOT_ASSIGNED"));
 }
 
 } // end of anonymous namespace