]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[#3858] Addressed review comments
authorThomas Markwalder <tmark@isc.org>
Tue, 3 Jun 2025 14:00:30 +0000 (10:00 -0400)
committerThomas Markwalder <tmark@isc.org>
Tue, 3 Jun 2025 14:48:45 +0000 (14:48 +0000)
minor nits:

modified:   src/bin/dhcp4/tests/hooks_unittest.cc
modified:   src/hooks/dhcp/ping_check/ping_check_mgr.cc
modified:   src/hooks/dhcp/ping_check/tests/ping_check_mgr_unittests.cc

src/bin/dhcp4/tests/hooks_unittest.cc
src/hooks/dhcp/ping_check/ping_check_mgr.cc
src/hooks/dhcp/ping_check/tests/ping_check_mgr_unittests.cc

index fce8f2617c512f097a1ad3500be55c356bcd787b..8db55c505c969a1c26e314973f90d4caabaef469 100644 (file)
@@ -1152,7 +1152,7 @@ public:
     /// Old lease returned in the lease4_offer callout
     static Lease4Ptr callback_old_lease_;
 
-    /// Currenth host returned in the lease4_offer callout
+    /// Current host returned in the lease4_offer callout
     static ConstHostPtr callback_current_host_;
 
     /// Hostname argument returned in ddns4_update callout.
index 9ebe69cba1c3f7e4f1283884aca6a50e7da9b88b..aadea02934cf0ccdba2c75dd7adae4c0d2c75dd3 100644 (file)
@@ -510,13 +510,13 @@ PingCheckMgr::shouldPing(Lease4Ptr& lease, Pkt4Ptr& query,
         return (CalloutHandle::CalloutNextStep::NEXT_STEP_CONTINUE);
     }
 
-    // If there's a previous lease that belongs to this client and
-    // it was touched by the client less than ping-cltt-secs ago then
+    // If there's a previous lease that belongs to this client and it either
+    // active or was touched by the client less than ping-cltt-secs ago then
     // no check is needed.  Drop the query from parking and release the
     // offer to the client,
     if (old_lease && (old_lease->addr_ == lease->addr_)) {
         if (old_lease->belongsToClient(lease->hwaddr_, lease->client_id_)) {
-            if (!old_lease->expired() || 
+            if (!old_lease->expired() ||
                 ((time(0) - old_lease->cltt_) < config->getPingClttSecs())) {
                 return (CalloutHandle::CalloutNextStep::NEXT_STEP_CONTINUE);
             }
index 673a39d61f1d8c829f55a62e6742c11b34d82681..e885dfcb9a32fbb28d00c0dd2a7e8dfd1291f4b3 100644 (file)
@@ -752,7 +752,7 @@ public:
         SKIP_IF(notRoot());
 
         // Create manager with thread-pool size of 3, min_echos 2, reply_timeout 250 ms.
-        // ST mode should ingore requested thread number.
+        // ST mode should ignore requested thread number.
         ASSERT_NO_THROW_LOG(createMgr(3, 2, 250));
         ASSERT_TRUE(mgr_);
 
@@ -839,7 +839,7 @@ public:
         SKIP_IF(notRoot());
 
         // Create a paused manager. 3 threads, 2 echos, 250 ms timeout.
-        // ST mode should ingore requested thread number.
+        // ST mode should ignore requested thread number.
         createMgr(3, 2, 250, true);
 
         // Calling nextToSend() should return false.
@@ -901,7 +901,7 @@ public:
         SKIP_IF(notRoot());
 
         // Create a paused manager. 3 threads, 2 echos, 500 ms timeout.
-        // ST mode should ingore requested thread number.
+        // ST mode should ignore requested thread number.
         createMgr(3, 2, 500, true);
 
         // Should not have an expiration time, timer should not be running.
@@ -1009,7 +1009,7 @@ public:
         SKIP_IF(notRoot());
 
         // Create a paused manager. 3 threads, 2 echos, 500 ms timeout.
-        // ST mode should ingore requested thread number.
+        // ST mode should ignore requested thread number.
         createMgr(3, 2, 500, true);
 
         // Start a ping for an address so we have a context.
@@ -1069,7 +1069,7 @@ public:
         SKIP_IF(notRoot());
 
         // Create a paused manager. 3 threads, 2 echos, 500 ms timeout.
-        // ST mode should ingore requested thread number.
+        // ST mode should ignore requested thread number.
         createMgr(3, 2, 500, true);
 
         // Install a post reply received callback to stop the test if we're done.
@@ -1140,7 +1140,7 @@ public:
         SKIP_IF(notRoot());
 
         // Create a paused manager. 3 threads, 2 echos, 500 ms timeout.
-        // ST mode should ingore requested thread number.
+        // ST mode should ignore requested thread number.
         createMgr(3, 2, 500, true);
 
         // Install a post reply received callback to stop the test if we're done.
@@ -1205,7 +1205,7 @@ public:
         SKIP_IF(notRoot());
 
         // Create a paused manager. 3 threads, 1 echos, 250 ms timeout.
-        // ST mode should ingore requested thread number.
+        // ST mode should ignore requested thread number.
         createMgr(3, 1, 250, true);
 
         // Start four ping checks, then stage them so:
@@ -1290,7 +1290,7 @@ public:
         // Create manager with thread-pool size of 3, min_echos 1,
         // reply_timeout 1000 milliseconds.  Larger time out for this test
         // avoids sporadic expirations which leads to unaccounted for UNPARKs.
-        // ST mode should ingore requested thread number.
+        // ST mode should ignore requested thread number.
         ASSERT_NO_THROW_LOG(createMgr(3, 1, 1000));
         ASSERT_TRUE(mgr_);
 
@@ -1341,7 +1341,7 @@ public:
         // Create manager with thread-pool size of 3, min_echos 1,
         // reply_timeout 1000 milliseconds.  Larger time out for this test
         // avoids sporadic expirations which leads to unaccounted for UNPARKs.
-        // ST mode should ingore requested thread number.
+        // ST mode should ignore requested thread number.
         ASSERT_NO_THROW_LOG(createMgr(3, 1, 1000));
         ASSERT_TRUE(mgr_);
 
@@ -1436,7 +1436,7 @@ public:
 
         // Create manager with thread-pool size of 3, min_echos 1,
         // reply_timeout 250 milliseconds.
-        // ST mode should ingore requested thread number.
+        // ST mode should ignore requested thread number.
         ASSERT_NO_THROW_LOG(createMgr(3, 1, 250));
         ASSERT_TRUE(mgr_);
 
@@ -1488,7 +1488,7 @@ public:
 
         // Create manager with thread-pool size of 3, min_echos 1,
         // reply_timeout 250 milliseconds.
-        // ST mode should ingore requested thread number.
+        // ST mode should ignore requested thread number.
         ASSERT_NO_THROW_LOG(createMgr(3, 1, 250));
         ASSERT_TRUE(mgr_);