key = dict_attr_child_by_num(CURRENT_FRAME(dctx)->da, i);
if (!key) continue; /* really should be WTF? */
+ /*
+ * @todo - we can allow this if the _rest_ of the struct is fixed size, i.e. if
+ * there is a key field, and then the union is fixed size.
+ */
if (fr_dict_attr_is_key_field(key)) {
fr_strerror_printf("'struct' %s has a 'key' field %s, and cannot end with a TLV %s",
CURRENT_FRAME(dctx)->da->name, key->name, argv[0]);
* key fields. Yes, this is O(N^2), but
* the structs are small.
*/
- if (flags->extra && (flags->subtype == FLAG_KEY_FIELD)) {
+ if (fr_dict_attr_is_key_field(da)) {
for (i = 1; i < attr; i++) {
sibling = fr_dict_attr_child_by_num(parent, i);
if (!sibling) {