Commit 91766237 authored by Francis Dupont's avatar Francis Dupont
Browse files

[3389a] Moved re-detect default to simple_parse[46]

parent 20bade2d
......@@ -488,9 +488,6 @@ configureDhcp4Server(Dhcpv4Srv&, isc::data::ConstElementPtr config_set,
if (check_only) {
// No re-detection in check only mode
ifaces_cfg->set("re-detect", Element::create(false));
} else if (!ifaces_cfg->contains("re-detect")) {
// Else the default is to re-detect
ifaces_cfg->set("re-detect", Element::create(true));
}
IfacesConfigParser parser(AF_INET);
CfgIfacePtr cfg_iface = srv_cfg->getCfgIface();
......
......@@ -75,6 +75,11 @@ const SimpleDefaults SimpleParser4::SUBNET4_DEFAULTS = {
{ "4o6-subnet", Element::string, "" },
};
/// @brief This table defines default values for interfaces for DHCPv4.
const SimpleDefaults SimpleParser4::IFACE4_DEFAULTS = {
{ "re-detect", Element::boolean, "true" }
};
/// @brief List of parameters that can be inherited from the global to subnet4 scope.
///
/// Some parameters may be defined on both global (directly in Dhcp4) and
......@@ -120,6 +125,13 @@ size_t SimpleParser4::setAllDefaults(isc::data::ElementPtr global) {
cnt += setListDefaults(subnets, SUBNET4_DEFAULTS);
}
// Set the defaults for interfaces config
ConstElementPtr ifaces_cfg = global->get("interfaces-config");
if (ifaces_cfg) {
ElementPtr mutable_cfg = boost::const_pointer_cast<Element>(ifaces_cfg);
cnt += setDefaults(mutable_cfg, IFACE4_DEFAULTS);
}
return (cnt);
}
......
......@@ -41,6 +41,7 @@ public:
static const isc::data::SimpleDefaults OPTION4_DEFAULTS;
static const isc::data::SimpleDefaults GLOBAL4_DEFAULTS;
static const isc::data::SimpleDefaults SUBNET4_DEFAULTS;
static const isc::data::SimpleDefaults IFACE4_DEFAULTS;
static const isc::data::ParamsList INHERIT_GLOBAL_TO_SUBNET4;
};
......
......@@ -699,9 +699,6 @@ configureDhcp6Server(Dhcpv6Srv&, isc::data::ConstElementPtr config_set,
if (check_only) {
// No re-detection in check only mode
ifaces_cfg->set("re-detect", Element::create(false));
} else if (!ifaces_cfg->contains("re-detect")) {
// Else the default is to re-detect
ifaces_cfg->set("re-detect", Element::create(true));
}
IfacesConfigParser parser(AF_INET6);
CfgIfacePtr cfg_iface = srv_config->getCfgIface();
......
......@@ -72,6 +72,11 @@ const SimpleDefaults SimpleParser6::SUBNET6_DEFAULTS = {
{ "interface-id", Element::string, "" },
};
/// @brief This table defines default values for interfaces for DHCPv6.
const SimpleDefaults SimpleParser6::IFACE6_DEFAULTS = {
{ "re-detect", Element::boolean, "true" }
};
/// @brief List of parameters that can be inherited from the global to subnet6 scope.
///
/// Some parameters may be defined on both global (directly in Dhcp6) and
......@@ -119,6 +124,13 @@ size_t SimpleParser6::setAllDefaults(isc::data::ElementPtr global) {
cnt += setListDefaults(subnets, SUBNET6_DEFAULTS);
}
// Set the defaults for interfaces config
ConstElementPtr ifaces_cfg = global->get("interfaces-config");
if (ifaces_cfg) {
ElementPtr mutable_cfg = boost::const_pointer_cast<Element>(ifaces_cfg);
cnt += setDefaults(mutable_cfg, IFACE6_DEFAULTS);
}
return (cnt);
}
......
......@@ -42,6 +42,7 @@ public:
static const isc::data::SimpleDefaults OPTION6_DEFAULTS;
static const isc::data::SimpleDefaults GLOBAL6_DEFAULTS;
static const isc::data::SimpleDefaults SUBNET6_DEFAULTS;
static const isc::data::SimpleDefaults IFACE6_DEFAULTS;
static const isc::data::ParamsList INHERIT_GLOBAL_TO_SUBNET6;
};
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment