2
0
mirror of https://gitlab.isc.org/isc-projects/kea synced 2025-08-31 22:15:23 +00:00

[295-min-max-lease-time-configuration-options] Removed default- keywords

This commit is contained in:
Francis Dupont
2019-05-17 13:07:42 +02:00
parent ba9b894b6a
commit 9ef628e779
12 changed files with 42 additions and 174 deletions

View File

@@ -28,14 +28,6 @@ BaseNetworkParser::parseLifetime(const ConstElementPtr& scope,
value = getInteger(scope, name);
has_value = true;
}
if (scope->contains("default-" + name)) {
if (has_value) {
isc_throw(DhcpConfigError, "have both " << name << " and default-"
<< name << " in " << scope->getPosition());
}
value = getInteger(scope, "default-" + name);
has_value = true;
}
if (scope->contains("min-" + name)) {
min_value = getInteger(scope, "min-" + name);
has_min = true;
@@ -67,8 +59,8 @@ BaseNetworkParser::parseLifetime(const ConstElementPtr& scope,
} else {
// min and max.
isc_throw(DhcpConfigError, "have min-" << name << " and max-"
<< name << " but no default-" << name << " nor "
<< name << " in " << scope->getPosition());
<< name << " but no " << name << " (default) in "
<< scope->getPosition());
}
} else {
// max only.
@@ -77,7 +69,7 @@ BaseNetworkParser::parseLifetime(const ConstElementPtr& scope,
}
// Check that value is between min and max.
if ((value < min_value) || (value > max_value)) {
isc_throw(DhcpConfigError, "the value of default-" << name << " ("
isc_throw(DhcpConfigError, "the value of (default) " << name << " ("
<< value << ") is not between min-" << name << " ("
<< min_value << ") and max-" << name << " ("
<< max_value << ")");
@@ -157,7 +149,5 @@ BaseNetworkParser::parseHostReservationMode(const data::ConstElementPtr& network
}
}
} // end of namespace isc::dhcp
} // end of namespace isc