]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
it helps to parse unions here, too
authorAlan T. DeKok <aland@freeradius.org>
Mon, 25 Aug 2025 11:34:56 +0000 (07:34 -0400)
committerAlan T. DeKok <aland@freeradius.org>
Mon, 25 Aug 2025 12:10:30 +0000 (08:10 -0400)
src/lib/server/tmpl_tokenize.c
src/lib/util/pair_legacy.c

index 81b3c490bfb0c22ed4c096dd51a93c80626fbf0f..e6dd2d54ea5fab8361703cff83ddb16581bd985b 100644 (file)
@@ -2096,10 +2096,7 @@ do_suffix:
                        }
                        break;
 
-               case FR_TYPE_STRUCT:
-               case FR_TYPE_TLV:
-               case FR_TYPE_VENDOR:
-               case FR_TYPE_VSA:
+               case FR_TYPE_STRUCTURAL_EXCEPT_GROUP:
                is_union:
                        /*
                         *      Structural types are parented and namespaced from their parent da.
index 91e736d86ee02a9230809507cfb00ae8a8cc0a1f..f1f0844cb44e73d3a92f4401c6b6d1cb546492bd 100644 (file)
@@ -531,10 +531,7 @@ redo:
                 *      Reset the parsing to the new namespace if necessary.
                 */
                switch (vp->vp_type) {
-               case FR_TYPE_TLV:
-               case FR_TYPE_STRUCT:
-               case FR_TYPE_VSA:
-               case FR_TYPE_VENDOR:
+               case FR_TYPE_STRUCTURAL_EXCEPT_GROUP:
                        relative->ctx = vp;
                        relative->da = vp->da;
                        relative->list = &vp->vp_group;
@@ -555,7 +552,9 @@ redo:
                        relative->list = &vp->vp_group;
                        break;
 
-               default:
+               case FR_TYPE_UINT8:
+               case FR_TYPE_UINT16:
+               case FR_TYPE_UINT32:
                        /*
                         *      Key fields have children in their namespace, but the children go into the
                         *      parents context and list.
@@ -569,8 +568,16 @@ redo:
                                relative->ctx = parent_vp;
                                relative->da = vp->da;
                                relative->list = &parent_vp->vp_group;
+                               break;
                        }
+                       FALL_THROUGH;
+
+               default:
                        break;
+
+               case FR_TYPE_INTERNAL:
+                       fr_strerror_printf("Cannot parse internal data type %s", fr_type_to_str(vp->vp_type));
+                       return fr_sbuff_error(&our_in);
                }
 
                i++;