]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
allow FR_TYPE_ATTR to be passed in as enumv for decoding
authorAlan T. DeKok <aland@freeradius.org>
Tue, 29 Jul 2025 13:04:10 +0000 (09:04 -0400)
committerAlan T. DeKok <aland@freeradius.org>
Tue, 29 Jul 2025 13:04:10 +0000 (09:04 -0400)
src/lib/util/value.c

index 15455c6462b7c0937ef80a6847eb820fd61e052a..238f68d76f87029b9776cf284a60f440a630275d 100644 (file)
@@ -5505,8 +5505,15 @@ parse:
                        return -1;
                }
 
-               if (!dst_enumv->flags.is_root) {
-                       fr_strerror_const("Can only start from dictioanry root for data type 'attr'");
+               /*
+                *      @todo - have attributes of FR_TYPE_ATTR also
+                *      carry a ref to where their values are taken from.
+                */
+               if (dst_enumv->type == FR_TYPE_ATTR) {
+                       dst_enumv = fr_dict_root(dst_enumv->dict);
+
+               } else if (!dst_enumv->flags.is_root) {
+                       fr_strerror_printf("Can only start from dictionary root for data type 'attr', and not from %s", dst_enumv->name);
                        return -1;
                }