2
0
mirror of https://gitlab.isc.org/isc-projects/kea synced 2025-09-01 22:45:18 +00:00

[#2543] Implement changes for code review

This commit is contained in:
Dan Theisen
2022-10-10 19:49:47 -07:00
parent fb944776a6
commit 742179894b
5 changed files with 21 additions and 14 deletions

View File

@@ -105,11 +105,7 @@
"compatibility": { "compatibility": {
// Parse options more leniently where fields can be deduced // Parse options more leniently where fields can be deduced
// deterministically even if against RFC or common practice. // deterministically even if against RFC or common practice.
"lenient-option-parsing": true, "lenient-option-parsing": true
// Ignore Relay Agent Information Link Selection suboption if set
// to true. This will use normal subnet selection logic instead of
// attempting to use the subnet specified by the suboption.
"ignore-rai-link-selection": false
}, },
// Command control socket configuration parameters for Kea DHCPv4 server. // Command control socket configuration parameters for Kea DHCPv4 server.

View File

@@ -107,8 +107,10 @@
// deterministically even if against RFC or common practice. // deterministically even if against RFC or common practice.
"lenient-option-parsing": true, "lenient-option-parsing": true,
// Ignore Relay Agent Information Link Selection suboption if set // Ignore Relay Agent Information Link Selection suboption if set
// to true. This will use normal subnet selection logic instead of // to true. Enabling this will cause Kea use normal subnet
// attempting to use the subnet specified by the suboption. // selection logic instead of attempting to use the subnet
// specified in the suboption. This config option defaults to
// false, as enabling it breaks RFC compliance.
"ignore-rai-link-selection": false "ignore-rai-link-selection": false
}, },

View File

@@ -7196,7 +7196,11 @@ Ignore RAI Link Selection
With ``"ignore-rai-link-selection": true``, Relay Agent Information Link With ``"ignore-rai-link-selection": true``, Relay Agent Information Link
Selection suboption data will not be used for subnet selection. This will use Selection suboption data will not be used for subnet selection. This will use
normal subnet selection logic instead of attempting to use the subnet specified normal subnet selection logic instead of attempting to use the subnet specified
by the suboption. by the suboption. This option is not RFC compliant and is set to ``false`` by
default. Setting this option to ``true`` can help with subnet selection in
certain scenarios, for example, when your DHCP Relay Servers do not allow you
to specify which suboptions are included in the Relay Agent Information
option, and includes incorrect Link Selection information.
.. code-block:: json .. code-block:: json

View File

@@ -225,9 +225,11 @@ CfgSubnets4::initSelector(const Pkt4Ptr& query) {
OptionCustomPtr rai_custom = OptionCustomPtr rai_custom =
boost::dynamic_pointer_cast<OptionCustom>(rai); boost::dynamic_pointer_cast<OptionCustom>(rai);
if (rai_custom) { if (rai_custom) {
// If Relay Agent Information Link Selection is ignored in the configuration, skip // If Relay Agent Information Link Selection is ignored in the
// returning the related subnet selector here, and move on to normal subnet selection. // configuration, skip returning the related subnet selector here,
bool ignore_link_sel = CfgMgr::instance().getCurrentCfg()->getIgnoreRAILinkSelection(); // and move on to normal subnet selection.
bool ignore_link_sel = CfgMgr::instance().getCurrentCfg()->
getIgnoreRAILinkSelection();
if (!ignore_link_sel) { if (!ignore_link_sel) {
OptionPtr link_select = OptionPtr link_select =
rai_custom->getOption(RAI_OPTION_LINK_SELECTION); rai_custom->getOption(RAI_OPTION_LINK_SELECTION);

View File

@@ -1160,11 +1160,14 @@ private:
/// @brief Pointer to the configuration consistency settings /// @brief Pointer to the configuration consistency settings
CfgConsistencyPtr cfg_consist_; CfgConsistencyPtr cfg_consist_;
/// @brief Compatibility flags /// @name Compatibility flags
/// @{ ///
//@{
/// @brief Indicates whether lenient option parsing is enabled
bool lenient_option_parsing_; bool lenient_option_parsing_;
/// @brief Indicates whether RAI link-selection suboptions will be ignored
bool ignore_rai_link_selection_; bool ignore_rai_link_selection_;
/// @} //@}
/// @brief Flag which indicates if the server should do host reservations /// @brief Flag which indicates if the server should do host reservations
/// lookup before lease lookup. This parameter has effect only when /// lookup before lease lookup. This parameter has effect only when