which will let us encode DNS labels inside of structs, as that
is used in DHCPv6
unsigned int internal : 1; //!< Internal attribute, should not be received
///< in protocol packets, should not be encoded.
unsigned int array : 1; //!< Pack multiples into 1 attr.
+
+ unsigned int is_known_width : 1; //!< is treated as if it has a known width for structs
+
unsigned int has_value : 1; //!< Has a value.
unsigned int virtual : 1; //!< for dynamic expansion
return -1;
}
+ flags->is_known_width = true;
flags->length = length;
*type_p = type;
return 0;
* so, complain if we're adding a variable sized member.
*/
if (ctx->stack[ctx->stack_depth].da->flags.length &&
- ((type == FR_TYPE_TLV) ||
+ ((type == FR_TYPE_TLV) || flags.is_known_width ||
((type == FR_TYPE_STRING) && !flags.length) ||
((type == FR_TYPE_OCTETS) && !flags.length))) {
fr_strerror_printf("'struct' %s has fixed size %u, we cannot add a variable-sized member.",
return false;
}
+ flags->is_known_width = true;
+
return true;
}