]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
minor cleanups and notes
authorAlan T. DeKok <aland@freeradius.org>
Mon, 25 Aug 2025 12:20:32 +0000 (08:20 -0400)
committerAlan T. DeKok <aland@freeradius.org>
Mon, 25 Aug 2025 12:20:32 +0000 (08:20 -0400)
src/lib/util/dict_tokenize.c
src/lib/util/dict_validate.c

index 95deb64be87dd87bbd0da8739750fad1d186adfa..e0f1b547d28eb8fe9c7f0f9f4734156ffe7e4f12 100644 (file)
@@ -2349,6 +2349,10 @@ static int dict_read_process_member(dict_tokenize_ctx_t *dctx, char **argv, int
                        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]);
index 59a726e1710897c158f69960ae92fc00874ccd5e..1017550c53496499be4070bdac5c798caa62bccd 100644 (file)
@@ -576,7 +576,7 @@ bool dict_attr_flags_valid(fr_dict_attr_t *da)
                         *      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) {