]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[#4143] Checkpoint: addressed comments
authorFrancis Dupont <fdupont@isc.org>
Thu, 23 Jul 2026 14:24:13 +0000 (16:24 +0200)
committerFrancis Dupont <fdupont@isc.org>
Thu, 23 Jul 2026 14:24:26 +0000 (16:24 +0200)
src/hooks/dhcp/flex_option/flex_option.cc
src/hooks/dhcp/flex_option/flex_option.dox
src/hooks/dhcp/flex_option/flex_option.h
src/hooks/dhcp/flex_option/flex_option_messages.mes
src/hooks/dhcp/flex_option/tests/flex_option_unittests.cc
src/hooks/dhcp/flex_option/tests/sub_option_unittests.cc

index f7d9c05a468c83b99127c357038d4f8a6d58508e..1b8ce9a320a7744eb4f5a7ca87a7119d45468fbd 100644 (file)
@@ -314,7 +314,7 @@ FlexOptionImpl::parseOptionConfig(ConstElementPtr option) {
     // Consistency: if the destination is the query the source must be
     // the query too.
     if (!opt_cfg->getDestination() && !opt_cfg->getSource()) {
-      isc_throw(BadValue, "destination 'query' requires source 'query'");
+        isc_throw(BadValue, "destination 'query' requires source 'query'");
     }
 
     // Not working as expected: the destination is the query and classes
@@ -598,7 +598,6 @@ FlexOptionImpl::parseSubOption(ConstElementPtr sub_option,
             break;
         }
     }
-
 }
 
 void
index d458f499bd5a1fffeb5b1331ad716b73ebfe02d4..8dd7fafe5281193a8b1af6f92f9279e5c5998af8 100644 (file)
@@ -102,11 +102,11 @@ The sole parameter is a options list of options with:
  - @b source - Specifies what is the source for expression evaluation.
    The default is the query but this can be changed to the response.
    Note that if an expression includes a member clause the query classes
-   are copied to the response to make this to work.
+   are copied to the response to make this work.
  - @b destination - Specifies what is the destination of option changes.
    The default is the response but this can be changed to the query.
    Note the change is performed before the classification so
-   @ client-class or a member clause in expression is very likely
+   @b client-class or a member clause in expression is very likely
    to not work as expected. A warning is emitted when this situation
    is detected when the configuration is parsed.
 
index 5a95dce2d4d8fd47a6c58d87807b5d58fbdd8536..41642060f6088d00bd9cdf209b6bdea4cb90e0dd 100644 (file)
@@ -592,7 +592,6 @@ public:
         }
     }
 
-
     /// @brief Log the client class for option.
     ///
     /// @param client_class The client class aka guard name.
index 7402f50c0ee53ef48dda93255a22d77b7925b110..b91cb2b54ea846038d10bdf2d7c453683411486e 100644 (file)
@@ -20,7 +20,7 @@ class name are displayed.
 This warning message indicates the config specifies an expression
 with a member clause when the destination is the query but the callout point
 for patching queries is before the classification so it will very likely
-not work as expected. The code of the sub-option and option, and the
+not work as expected. The codes of the sub-option and option, and the
 expression are displayed.
 
 % FLEX_OPTION_CONFIG_USELESS_CLASS For the option code %1 the client class %2 is required before classification for a query destination
index b180181f0ef0c4ad2622469ad3a995b86b08b3d4..a7e009ee011f0ce72f947a25917f3d3bd59f04ef 100644 (file)
@@ -2008,7 +2008,7 @@ TEST_F(FlexOptionLogTest, classWarning) {
     EXPECT_EQ(0U, countFile("FLEX_OPTION_CONFIG_USELESS_MEMBER"));
 }
 
-// Verify that client-classes does not trigger a warning by default.
+// Verify that TokenMember triggers a warning with query destination.
 TEST_F(FlexOptionLogTest, memberWarning) {
     ElementPtr options = Element::createList();
     ElementPtr option = Element::createMap();
index 57de021a004cc44feedabe81fe4f20bbbe9faab7..d092d00ca65208b0430d7295b5f672ac3073fdc0 100644 (file)
@@ -1115,7 +1115,6 @@ TEST_F(FlexSubOptionTest, subProcessNoResponse) {
     EXPECT_TRUE(impl_->getErrMsg().empty()) << impl_->getErrMsg();
 
     Pkt4Ptr query(new Pkt4(DHCPDISCOVER, 12345));
-
     EXPECT_NO_THROW(impl_->process<Pkt4Ptr>(Option::V4, query, Pkt4Ptr()));
 }
 
@@ -3488,7 +3487,7 @@ TEST_F(FlexSubOptionLogTest, classWarning) {
     EXPECT_EQ(0U, countFile("FLEX_OPTION_CONFIG_SUB_USELESS_MEMBER"));
 }
 
-// Verify that client-classes does not trigger a warning by default.
+// Verify that TokenMember triggers a warning with query destination.
 TEST_F(FlexSubOptionLogTest, memberWarning) {
     OptionDefSpaceContainer defs;
     OptionDefinitionPtr def(new OptionDefinition("my-container", 222,