<ulink url="https://tools.ietf.org/html/rfc3315#section-9">RFC 3315</ulink>
for a description of all the options.</para>
- <para>The following values are understood:
+ <para>This takes an integer in the range 0…65535, or one of the following string values:
<variablelist>
<varlistentry>
<term><option>vendor</option></term>
type = duid_type_from_string(type_string);
if (type < 0) {
- log_syntax(unit, LOG_WARNING, filename, line, type,
- "Failed to parse DUID type '%s', ignoring.", type_string);
- return 0;
+ uint16_t t;
+
+ r = safe_atou16(type_string, &t);
+ if (r < 0) {
+ log_syntax(unit, LOG_WARNING, filename, line, r,
+ "Failed to parse DUID type '%s', ignoring.", type_string);
+ return 0;
+ }
+
+ type = t;
+ assert(type == t); /* Check if type can store uint16_t. */
}
if (!isempty(p)) {