]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[#2819] Addressed review comments
authorThomas Markwalder <tmark@isc.org>
Fri, 13 Dec 2024 16:15:18 +0000 (11:15 -0500)
committerThomas Markwalder <tmark@isc.org>
Mon, 16 Dec 2024 15:15:09 +0000 (10:15 -0500)
Changes to be committed:
    modified:   src/lib/dhcpsrv/dhcpsrv_messages.mes
    modified:   src/lib/dhcpsrv/ncr_generator.cc
modified:   src/lib/dhcpsrv/srv_config.h
modified:   src/lib/dhcpsrv/tests/dhcp_parsers_unittest.cc
modified:   src/lib/dhcpsrv/tests/ncr_generator_unittest.cc
modified:   src/lib/dhcpsrv/tests/shared_network_parser_unittest.cc
modified:   src/lib/dhcpsrv/tests/srv_config_unittest.cc
modified:   src/lib/util/str.h

src/lib/dhcpsrv/dhcpsrv_messages.mes
src/lib/dhcpsrv/ncr_generator.cc
src/lib/dhcpsrv/srv_config.h
src/lib/dhcpsrv/tests/dhcp_parsers_unittest.cc
src/lib/dhcpsrv/tests/ncr_generator_unittest.cc
src/lib/dhcpsrv/tests/shared_network_parser_unittest.cc
src/lib/dhcpsrv/tests/srv_config_unittest.cc
src/lib/util/str.h

index 3329e13f602b817d1136be219b4288b62fbf42fa..6d6185a3e9947e1de605839c2b4aedaa80836a00 100644 (file)
@@ -967,8 +967,8 @@ message) that is unknown to the software. This is a configuration error.
 % DHCPSRV_DDNS_TTL_TOO_SMALL %1 of lease life time %2 is %3, using minimum of %4 instead.
 Logged at debug log level 55.
 A debug message issued when the DDNS TTL value calculated using the
-ddns-ttl-percent if specfieed or (0.33 if not) is too small.  Kea will
-ignore the value and is the minimum (ddns-ttl-min is specifed or 600
+ddns-ttl-percent if specified or (0.33 if not) is too small.  Kea will
+ignore the value and use the minimum (ddns-ttl-min if specifed or 600
 seconds if not). The message details include the percentage, the lease
 life time, the calculated TTL, and the value actually used.
 
@@ -977,6 +977,6 @@ Logged at debug log level 55.
 A debug message issued when the DDNS TTL value calculated using the
 ddns-ttl-percent if specfieed or (0.33 if not) is larger than the
 the specified value of ddns-ttl-max. Kea will ignore the value and
-use  is the specified maxinimum instead. The message details include
+use the specified maximum instead. The message details include
 the percentage, the lease life time, the calculated TTL, and the value
 actually used.
index 36417f06c397d951c641af347c8c8c97a9dfaf7f..c9584bd4f4bc8eec41b88c46ba2a2a95d663d3d3 100644 (file)
@@ -160,7 +160,7 @@ uint32_t calculateDdnsTtl(uint32_t lease_lft,
     // Adjust for minimum and maximum.
     // If we have a custom mininum enforce it, otherwise per RFC 4702 it
     // should not less than 600.
-    uint32_t ttl_min = (ddns_ttl_min.get() > 0) ?  ddns_ttl_min.get() : 600;
+    uint32_t ttl_min = (ddns_ttl_min.get() > 0) ? ddns_ttl_min.get() : 600;
     if (ttl < ttl_min) {
         LOG_DEBUG(dhcpsrv_logger, DHCPSRV_DBG_TRACE_DETAIL_DATA,
                       DHCPSRV_DDNS_TTL_TOO_SMALL)
index 33f846fefbc1f03a24707f938a728d9dd62fd90a..0b2b1b047f79fd3b75d62762f675ee3403d031a0 100644 (file)
@@ -976,10 +976,10 @@ public:
                               const std::string& name) const;
 
     /// @brief Conducts sanity checks on global DDNS ttl parameters:
-    /// ddsn-ttl, ddsn-ttl-percent, ddns-ttl-min, ddns-ttl-max
+    /// ddns-ttl, ddns-ttl-percent, ddns-ttl-min, ddns-ttl-max
     ///
-    /// If ddns-ttl is specified none of the others can be
-    /// If ddns-ttl-min and ddsn-ttl-max are specified max cannot
+    /// If ddns-ttl is specified none of the others can be.
+    /// If ddns-ttl-min and ddns-ttl-max are specified max cannot
     /// be less than min. 
     ///
     /// @throw Throws BadValue if any of the rules are violated.
index e8720bfeb0e5475450ab83df7dd26549a7566e48..a9d76564c0c1d6ca44e1657df6ba11761fb15cc6 100644 (file)
@@ -73,8 +73,8 @@ public:
         CfgMgr::instance().clear();
     }
 
-       // Verifies valid permuatations of ddns-ttl-percent, ddns-ttl,
-       // ddns-ttl-min, and ddns-ttl-max values for SubnetX.
+    // Verifies valid permuatations of ddns-ttl-percent, ddns-ttl,
+    // ddns-ttl-min, and ddns-ttl-max values for SubnetX.
     template<typename ParserType, typename NetworkPtrType>
        void validDdnsTtlParmatersSubnet(int family) {
            struct Scenario {
index da877d17654ca8665ee1ce0d4a797589700d46a7..98807197c456428d13b064325df210ef373984ea 100644 (file)
@@ -761,16 +761,16 @@ TEST_F(NCRGenerator4Test, calculateDdnsTtlThroughQueueNcr) {
         // Explicit ttl wins over specified percent
         { __LINE__, 2100, 0.25,       900,    no_min, no_max, 900 },
 
-        // Explicit ttl wins over specified minumum
+        // Explicit ttl wins over specified minimum
         { __LINE__, 2100, no_percent, 900,    1000,   no_max, 900 },
 
         // Explicit ttl wins over specified maxiumum
         { __LINE__, 2100, no_percent, 900,   no_min,  800,    900 },
 
-        // Specified percent > RFC minumum
+        // Specified percent > RFC minimum
         { __LINE__, 2100, 0.5,        no_ttl, no_min, no_max, 1050 },
 
-        // Specified percent < RFC minumum
+        // Specified percent < RFC minimum
         { __LINE__, 2100, 0.25,       no_ttl, no_min, no_max, 600 },
 
         // Specified percent < specified minimum < RFC minimum
index f384700d40a9cb77611bf47d87e168cd9de49cb3..3128867206555b01e1a836fddac69856f2b01201 100644 (file)
@@ -107,7 +107,7 @@ public:
     /// @return A reference to the Network created if parsing is successful
     virtual Network& parseIntoNetwork(ConstElementPtr test_config) = 0;
 
-    // Verifies valid permuatations of ddns-ttl-percent, ddns-ttl,
+    // Verifies valid permutations of ddns-ttl-percent, ddns-ttl,
     // ddns-ttl-min, and ddns-ttl-max values for SharedNetwork4.
     template<typename NetworkTypePtr, typename ParserType>
     void validDdnsTtlParmatersTest() {
@@ -197,7 +197,7 @@ public:
         }
     }
 
-    // Verifies invalid permuatations of ddns-ttl-percent, ddns-ttl,
+    // Verifies invalid permatations of ddns-ttl-percent, ddns-ttl,
     // ddns-ttl-min, and ddns-ttl-max values for SharedNetwork.
     template<typename ParserType>
     void invalidDdnsTtlParmatersTest() {
@@ -1362,25 +1362,25 @@ TEST_F(SharedNetwork6ParserTest, deprecatedClientClass) {
                      " (<string>:1:2)");
 }
 
-// Verifies valid permuatations of ddns-ttl-percent, ddns-ttl,
+// Verifies valid permutations of ddns-ttl-percent, ddns-ttl,
 // ddns-ttl-min, and ddns-ttl-max values for SharedNetwork4.
 TEST_F(SharedNetwork4ParserTest, validDdnsTtlParmaters4) {
     validDdnsTtlParmatersTest<SharedNetwork4Ptr, SharedNetwork4Parser>();
 }
 
-// Verifies valid permuatations of ddns-ttl-percent, ddns-ttl,
+// Verifies valid permutations of ddns-ttl-percent, ddns-ttl,
 // ddns-ttl-min, and ddns-ttl-max values for SharedNetwork6.
 TEST_F(SharedNetwork6ParserTest, validDdnsTtlParmaters6) {
     validDdnsTtlParmatersTest<SharedNetwork6Ptr, SharedNetwork6Parser>();
 }
 
-// Verifies invalid permuatations of ddns-ttl-percent, ddns-ttl,
+// Verifies invalid permutations of ddns-ttl-percent, ddns-ttl,
 // ddns-ttl-min, and ddns-ttl-max values for Subnet4.
 TEST_F(SharedNetwork4ParserTest, invalidDdnsTtlParmaters4) {
     invalidDdnsTtlParmatersTest<SharedNetwork4Parser>();
 }
 
-// Verifies invalid permuatations of ddns-ttl-percent, ddns-ttl,
+// Verifies invalid permutations of ddns-ttl-percent, ddns-ttl,
 // ddns-ttl-min, and ddns-ttl-max values for Subnet6.
 TEST_F(SharedNetwork6ParserTest, invalidDdnsTtlParmaters6) {
     invalidDdnsTtlParmatersTest<SharedNetwork6Parser>();
index 531b8ce7fea4aa23d1768f3866d7020b14e6e2f2..100660da86eaf5b811635e5285e5ba6f06d6baad 100644 (file)
@@ -2214,7 +2214,7 @@ TEST_F(SrvConfigTest, sanityChecksLifetime) {
     }
 }
 
-// Verifies that sanityChecksDdnsTtlParams works as expected.
+// Verifies that sanityChecksDdnsTtlParameters works as expected.
 TEST_F(SrvConfigTest, sanityChecksDdnsTtlParameters) {
     {
         SCOPED_TRACE("none");
index c89294dc11cd226d577782499d010671a57ec4a1..d048f0181d2ba9c3e9cf2511f07de942fb425a1c 100644 (file)
@@ -290,7 +290,7 @@ dumpAsHex(const uint8_t* data, size_t length);
 ///
 /// @param val double to convert
 /// @param precision number of maxium number decimal places to output
-/// @return string representaion of val
+/// @return string representation of val
 std::string dumpDouble(double val, size_t precision = 5);
 
 }  // namespace str