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] Added bad lifetime error checks

This commit is contained in:
Francis Dupont
2019-06-18 22:38:24 +02:00
parent cba7cd443a
commit 25c3e87cf6
3 changed files with 146 additions and 12 deletions

View File

@@ -67,6 +67,12 @@ BaseNetworkParser::parseLifetime(const ConstElementPtr& scope,
min_value = max_value;
value = max_value;
}
// Check that min <= max.
if (min_value > max_value) {
isc_throw(DhcpConfigError, "the value of min-" << name << " ("
<< min_value << ") is not less than max-" << name << " ("
<< max_value << ")");
}
// Check that value is between min and max.
if ((value < min_value) || (value > max_value)) {
isc_throw(DhcpConfigError, "the value of (default) " << name << " ("