From 6c6162fd13988f03e45aa7c2f1043f3389c446d6 Mon Sep 17 00:00:00 2001 From: "Alan T. DeKok" Date: Fri, 11 Mar 2022 09:06:12 -0500 Subject: [PATCH] allow fixed-size data types to have "array" flag, too --- src/lib/util/dict_validate.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/lib/util/dict_validate.c b/src/lib/util/dict_validate.c index 742be8165e..1f28e5b218 100644 --- a/src/lib/util/dict_validate.c +++ b/src/lib/util/dict_validate.c @@ -478,7 +478,18 @@ bool dict_attr_flags_valid(fr_dict_t *dict, fr_dict_attr_t const *parent, case FR_TYPE_STRUCT: ALLOW_FLAG(extra); ALLOW_FLAG(subtype); - if (flags->is_known_width) ALLOW_FLAG(array); + + if (flags->array) { + switch (type) { + case FR_TYPE_FIXED_SIZE: + ALLOW_FLAG(array); + break; + + default: + if (flags->is_known_width) ALLOW_FLAG(array); + break; + } + } if (all_flags) { fr_strerror_const("Invalid flag for attribute inside of a 'struct'"); return false; -- 2.47.3