From: Francis Dupont Date: Wed, 22 Jul 2026 12:13:11 +0000 (+0200) Subject: [#4496] Addressed comments X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=HEAD;p=thirdparty%2Fkea.git [#4496] Addressed comments --- diff --git a/src/bin/dhcp6/tests/config_parser_unittest.cc b/src/bin/dhcp6/tests/config_parser_unittest.cc index bef6d9e539..8cf7896be0 100644 --- a/src/bin/dhcp6/tests/config_parser_unittest.cc +++ b/src/bin/dhcp6/tests/config_parser_unittest.cc @@ -3873,7 +3873,7 @@ TEST_F(Dhcp6ParserTest, optionDataNtpServer) { ASSERT_TRUE(status); checkResult(status, 0); - // We should have one option available. + // We should have one option available. OptionContainerPtr options = CfgMgr::instance().getStagingCfg()->getCfgOption()->getAll(DHCP6_OPTION_SPACE); ASSERT_TRUE(options); diff --git a/src/lib/dhcpsrv/cfg_option.cc b/src/lib/dhcpsrv/cfg_option.cc index 7df192bd11..a88f62679d 100644 --- a/src/lib/dhcpsrv/cfg_option.cc +++ b/src/lib/dhcpsrv/cfg_option.cc @@ -353,8 +353,7 @@ CfgOption::encapsulateInternal(const OptionPtr& option) { // Add sub-option if there isn't one added already, or // if encapsulating space is a multiple exception. - OptionPtr existing = option->getOption(encap_opt.option_->getType()); - if (multiple_encapsulating | + if (multiple_encapsulating || !option->getOption(encap_opt.option_->getType())) { option->addOption(encap_opt.option_); } diff --git a/src/lib/dhcpsrv/cfg_option.h b/src/lib/dhcpsrv/cfg_option.h index 48779ce27b..0b7f605217 100644 --- a/src/lib/dhcpsrv/cfg_option.h +++ b/src/lib/dhcpsrv/cfg_option.h @@ -604,7 +604,7 @@ public: return (encapsulated_); } - /// @brief Option spaces which can encapsulate mutiple sub-options + /// @brief Option spaces which can encapsulate multiple sub-options /// of the same type. static std::set multiple_encapsulating_spaces_; diff --git a/src/lib/dhcpsrv/tests/cfg_option_unittest.cc b/src/lib/dhcpsrv/tests/cfg_option_unittest.cc index 7dfbb84fc4..946261fecb 100644 --- a/src/lib/dhcpsrv/tests/cfg_option_unittest.cc +++ b/src/lib/dhcpsrv/tests/cfg_option_unittest.cc @@ -801,7 +801,7 @@ TEST_F(CfgOptionTest, encapsulate) { } } -// This test verifies that multiple encapsulating spaces are supported, +// This test verifies that multiple encapsulating spaces are supported. TEST_F(CfgOptionTest, multipleEncapsulatingSpaces) { CfgOption cfg;