From: Piotrek Zadroga Date: Wed, 22 Nov 2023 09:17:12 +0000 (+0100) Subject: [#3074] option def validation X-Git-Tag: Kea-2.5.5~55 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=79a331fae183ab3f53d42e4cb8e1e3d70a305665;p=thirdparty%2Fkea.git [#3074] option def validation --- diff --git a/src/lib/dhcp/option_definition.cc b/src/lib/dhcp/option_definition.cc index 40d46b0cda..8e2b8403f4 100644 --- a/src/lib/dhcp/option_definition.cc +++ b/src/lib/dhcp/option_definition.cc @@ -408,6 +408,12 @@ OptionDefinition::validate() const { << " an option record."; 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 (err_str.str().empty() && array_type_) { @@ -437,6 +443,10 @@ OptionDefinition::validate() const { err_str << "array of empty value is not" << " a valid option definition."; + } else if (type_ == OPT_CUSTOM_TYPE) { + err_str << "array of custom type value is not" + << " a valid option definition."; + } }