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:
@@ -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 << " ("
|
||||
|
Reference in New Issue
Block a user