mirror of
https://gitlab.isc.org/isc-projects/kea
synced 2025-08-31 14:05:33 +00:00
[#3074] option def validation
This commit is contained in:
@@ -408,6 +408,12 @@ OptionDefinition::validate() const {
|
|||||||
<< " an option record.";
|
<< " an option record.";
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
// Custom type is not allowed within a record.
|
||||||
|
if (*it == OPT_CUSTOM_TYPE) {
|
||||||
|
err_str << "custom data type can't be stored as a field in"
|
||||||
|
<< " an option record.";
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
// If the array flag is set the last field is an array.
|
// If the array flag is set the last field is an array.
|
||||||
if (err_str.str().empty() && array_type_) {
|
if (err_str.str().empty() && array_type_) {
|
||||||
@@ -437,6 +443,10 @@ OptionDefinition::validate() const {
|
|||||||
err_str << "array of empty value is not"
|
err_str << "array of empty value is not"
|
||||||
<< " a valid option definition.";
|
<< " a valid option definition.";
|
||||||
|
|
||||||
|
} else if (type_ == OPT_CUSTOM_TYPE) {
|
||||||
|
err_str << "array of custom type value is not"
|
||||||
|
<< " a valid option definition.";
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user