From: Alan T. DeKok Date: Tue, 21 Feb 2023 14:20:33 +0000 (-0500) Subject: allow MEMBERS to use "enum=..." for any leaf type X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=cc27d96c763a028e9dada7d8776b11c3774ddf7c;p=thirdparty%2Ffreeradius-server.git allow MEMBERS to use "enum=..." for any leaf type we rely on the rest of the code to do type / whatever sanity checks there's no need to duplicate them. --- diff --git a/doc/antora/modules/reference/pages/dictionary/member.adoc b/doc/antora/modules/reference/pages/dictionary/member.adoc index 6e97bda1f92..f9e217259bd 100644 --- a/doc/antora/modules/reference/pages/dictionary/member.adoc +++ b/doc/antora/modules/reference/pages/dictionary/member.adoc @@ -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. |===== diff --git a/src/lib/util/dict_tokenize.c b/src/lib/util/dict_tokenize.c index 65eb7b7ec18..e3538ef2968 100644 --- a/src/lib/util/dict_tokenize.c +++ b/src/lib/util/dict_tokenize.c @@ -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; }