]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[#3492] Addressed review comments
authorThomas Markwalder <tmark@isc.org>
Wed, 7 Aug 2024 13:58:19 +0000 (13:58 +0000)
committerThomas Markwalder <tmark@isc.org>
Wed, 7 Aug 2024 13:58:19 +0000 (13:58 +0000)
    Fixed ChangeLog, UT, and minor cleanups

ChangeLog
src/bin/dhcp4/tests/dhcp4_srv_unittest.cc
src/lib/dhcp/libdhcp++.cc
src/lib/dhcp/option_custom.cc
src/lib/dhcp/tests/libdhcp++_unittest.cc

index 5440820dc3650f5fa8d7dbd6f98bf6d9faee6c76..d1ea28a86aaadaa950d8f48c399f2c8abb194c12 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,12 +1,12 @@
 2269.  [func]          tmark
        Extended kea-dhcp4 and kea-dhcp6 lenient option parsing
-       to drop options which contain malformed FQDNs such as
-       DHO_V4_LOST_SERVER and D6O_V6_ACCESS_DOMAIN.
+       to drop FQDN options such as v4-lost and v6-access-domain
+       if they contain malformed FQDNs.
        (Gitlab #3492)
 
 Kea 2.7.1 (development) released on July 31, 2024
 
-2268.  [build]         ravan
+2268.  [build]         razvan
        The library version numbers have been bumped up for the Kea 2.7.1
        development release.
        (Gitlab #3515)
index 67364ea377b444ef47f0f162550b4eceaa923120..06dfeffe829b7bdce4529e3fcd6930db4a99dd1d 100644 (file)
@@ -6808,7 +6808,7 @@ TEST_F(StashAgentOptionTest, badRelayAgentInfo) {
     sub_options_ = Element::create(content);
     relay_agent_info_->set("sub-options", sub_options_);
 
-    EXPECT_THROW(srv_.recoverStashedAgentOption(query_), InvalidOptionValue);
+    EXPECT_THROW(srv_.recoverStashedAgentOption(query_), OptionParseError);
     EXPECT_FALSE(query_->inClass("STASH_AGENT_OPTIONS"));
 }
 
index 1c40b9cee1b245940fe40899c4c1938c2b3c96d8..867b6baefa5d5e7b3c6f71ee28ad7e53e55c5347 100644 (file)
@@ -445,8 +445,8 @@ LibDHCP::unpackOptions6(const OptionBuffer& buf, const string& option_space,
             } catch (const SkipRemainingOptionsError&) {
                 throw;
             } catch (const std::exception& ex) {
-                isc_throw(OptionParseError, "opt_type: " << (uint16_t)(opt_type)
-                                            << ", opt_len " << (uint16_t)(opt_len)
+                isc_throw(OptionParseError, "opt_type: " << static_cast<uint16_t>(opt_type)
+                                            << ", opt_len " << static_cast<uint16_t>(opt_len)
                                             << " error: " << ex.what());
             }
         }
index e7018dd79098a689745d848296b9e55846f511e0..202f802720be9c044b2c28fa3a44d513ede61157 100644 (file)
@@ -236,7 +236,8 @@ OptionCustom::bufferLength(const OptionDataType data_type, bool in_array,
             } catch (const std::exception& ex) {
                 if (Option::lenient_parsing_) {
                     isc_throw(SkipThisOptionError, "failed to read "
-                              "partial domain-name from wire format");
+                              "domain-name from wire format: "
+                              << ex.what());
                 }
 
                 throw;
index d6a7af859430135a4d9bcc6fbcc38ef19f376221..3985b711b19cc7e7852e925d75589f3c327c2b9d 100644 (file)
@@ -3659,7 +3659,7 @@ TEST_F(LibDhcpTest, unpackOptions4LenientFqdn) {
         DHO_DOMAIN_SEARCH,                            // invalid FQDN list
         2, 2, 56,
         DHO_TIME_OFFSET,                              // Valid int option
-        4,0,0,0,77
+        4, 0, 0, 0, 77
     };
 
     // List of parsed options will be stored here.