summaryrefslogtreecommitdiffstats
path: root/src/bin/dhcp4/config_parser.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/bin/dhcp4/config_parser.cc')
-rw-r--r--src/bin/dhcp4/config_parser.cc16
1 files changed, 11 insertions, 5 deletions
diff --git a/src/bin/dhcp4/config_parser.cc b/src/bin/dhcp4/config_parser.cc
index 777cce5d2b..7774edcaa0 100644
--- a/src/bin/dhcp4/config_parser.cc
+++ b/src/bin/dhcp4/config_parser.cc
@@ -265,7 +265,7 @@ protected:
Triplet<uint32_t> valid = getParam("valid-lifetime");
stringstream tmp;
- tmp << addr.toText() << "/" << (int)len
+ tmp << addr << "/" << (int)len
<< " with params t1=" << t1 << ", t2=" << t2 << ", valid=" << valid;
LOG_INFO(dhcp4_logger, DHCP4_CONFIG_NEW_SUBNET).arg(tmp.str());
@@ -396,6 +396,8 @@ DhcpConfigParser* createGlobalDhcp4ConfigParser(const std::string& config_id) {
parser = new HooksLibrariesParser(config_id);
} else if (config_id.compare("echo-client-id") == 0) {
parser = new BooleanParser(config_id, globalContext()->boolean_values_);
+ } else if (config_id.compare("dhcp-ddns") == 0) {
+ parser = new D2ClientConfigParser(config_id);
} else {
isc_throw(NotImplemented,
"Parser error: Global configuration parameter not supported: "
@@ -433,6 +435,10 @@ configureDhcp4Server(Dhcpv4Srv&, isc::data::ConstElementPtr config_set) {
LOG_DEBUG(dhcp4_logger, DBG_DHCP4_COMMAND,
DHCP4_CONFIG_START).arg(config_set->str());
+ // Before starting any subnet operations, let's reset the subnet-id counter,
+ // so newly recreated configuration starts with first subnet-id equal 1.
+ Subnet::resetSubnetID();
+
// Some of the values specified in the configuration depend on
// other values. Typically, the values in the subnet4 structure
// depend on the global values. Also, option values configuration
@@ -448,7 +454,7 @@ configureDhcp4Server(Dhcpv4Srv&, isc::data::ConstElementPtr config_set) {
// Some of the parsers alter the state of the system in a way that can't
// easily be undone. (Or alter it in a way such that undoing the change has
// the same risk of failure as doing the change.)
- ParserPtr hooks_parser_;
+ ParserPtr hooks_parser;
// The subnet parsers implement data inheritance by directly
// accessing global storage. For this reason the global data
@@ -489,7 +495,7 @@ configureDhcp4Server(Dhcpv4Srv&, isc::data::ConstElementPtr config_set) {
// Executing commit will alter currently-loaded hooks
// libraries. Check if the supplied libraries are valid,
// but defer the commit until everything else has committed.
- hooks_parser_ = parser;
+ hooks_parser = parser;
parser->build(config_pair.second);
} else {
// Those parsers should be started before other
@@ -557,8 +563,8 @@ configureDhcp4Server(Dhcpv4Srv&, isc::data::ConstElementPtr config_set) {
// This occurs last as if it succeeds, there is no easy way
// revert it. As a result, the failure to commit a subsequent
// change causes problems when trying to roll back.
- if (hooks_parser_) {
- hooks_parser_->commit();
+ if (hooks_parser) {
+ hooks_parser->commit();
}
}
catch (const isc::Exception& ex) {