summaryrefslogtreecommitdiffstats
path: root/src/bin/dhcp6
diff options
context:
space:
mode:
authorFrancis Dupont <fdupont@isc.org>2017-07-05 00:38:40 +0200
committerFrancis Dupont <fdupont@isc.org>2017-07-05 00:38:40 +0200
commit91766237871c4e0044af49d2d839054373259d39 (patch)
tree7324e8770b087c3a0e55180e83d6cdc4d2ab0341 /src/bin/dhcp6
parent[3389a] tabs => spaces (diff)
downloadkea-91766237871c4e0044af49d2d839054373259d39.tar.xz
kea-91766237871c4e0044af49d2d839054373259d39.zip
[3389a] Moved re-detect default to simple_parse[46]
Diffstat (limited to 'src/bin/dhcp6')
-rw-r--r--src/bin/dhcp6/json_config_parser.cc3
-rw-r--r--src/bin/dhcp6/simple_parser6.cc12
-rw-r--r--src/bin/dhcp6/simple_parser6.h1
3 files changed, 13 insertions, 3 deletions
diff --git a/src/bin/dhcp6/json_config_parser.cc b/src/bin/dhcp6/json_config_parser.cc
index cb733389bc..2646f55e48 100644
--- a/src/bin/dhcp6/json_config_parser.cc
+++ b/src/bin/dhcp6/json_config_parser.cc
@@ -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();
diff --git a/src/bin/dhcp6/simple_parser6.cc b/src/bin/dhcp6/simple_parser6.cc
index c6883cd70d..89a14b5b06 100644
--- a/src/bin/dhcp6/simple_parser6.cc
+++ b/src/bin/dhcp6/simple_parser6.cc
@@ -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);
}
diff --git a/src/bin/dhcp6/simple_parser6.h b/src/bin/dhcp6/simple_parser6.h
index 590e11a5d2..755f0c2b86 100644
--- a/src/bin/dhcp6/simple_parser6.h
+++ b/src/bin/dhcp6/simple_parser6.h
@@ -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;
};