]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
allow MEMBERS to use "enum=..." for any leaf type
authorAlan T. DeKok <aland@freeradius.org>
Tue, 21 Feb 2023 14:20:33 +0000 (09:20 -0500)
committerAlan T. DeKok <aland@freeradius.org>
Tue, 21 Feb 2023 14:20:33 +0000 (09:20 -0500)
we rely on the rest of the code to do type / whatever sanity checks
there's no need to duplicate them.

doc/antora/modules/reference/pages/dictionary/member.adoc
src/lib/util/dict_tokenize.c

index 6e97bda1f9255319e99032efa1cd095a1dcd8416..f9e217259bd21d02d5de6525d3e48e050b26ed22 100644 (file)
@@ -42,7 +42,8 @@ Common flags and meanings
 |=====
 | Name         | Description
 | `array`      | For fixed-size types, declare that the contents of the packet can have an array of this value.
-| `clone=...`  | For `tlv` types, clone (or copy) child definitions from another `tlv` type
+| `enum=...`   | For "leaf" types, copy xref:dictionary/value.adoc[VALUE]s from an `xref:dictionary/enum.adoc[ENUM].
+| `clone=...`  | For `tlv` or 'struct' types, clone (or copy) child definitions from another attribute of the same type
 | `key`        | This member is a "key" type.  The struct can have different xref:dictionary/struct.adoc[STRUCT] children depending on the value of the key.
 |=====
 
index 65eb7b7ec188891a0ae451a545bcd76c4a172eef..e3538ef29683ee83edb61649580459e10219a72c 100644 (file)
@@ -1279,11 +1279,6 @@ static int dict_read_process_member(dict_tokenize_ctx_t *ctx, char **argv, int a
        if (argc >= 3) {
                if (dict_process_flag_field(ctx, argv[2], type, &flags, &ref) < 0) return -1;
 
-               if (ref && (type != FR_TYPE_TLV) && !(flags.extra && (flags.subtype == FLAG_KEY_FIELD))) {
-                       fr_strerror_const("Only MEMBERs of type 'tlv' or with 'key' flags can have references");\
-                       return -1;
-               }
-
        } else {
                if (!dict_attr_flags_valid(ctx->dict, ctx->stack[ctx->stack_depth].da, argv[2], NULL, type, &flags)) return -1;
        }