]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
All structural types can contain references
authorArran Cudbard-Bell <a.cudbardb@freeradius.org>
Thu, 3 Dec 2020 15:59:18 +0000 (08:59 -0700)
committerArran Cudbard-Bell <a.cudbardb@freeradius.org>
Thu, 3 Dec 2020 15:59:18 +0000 (08:59 -0700)
src/lib/util/dict_util.c

index 537ce1de885756fd97cbcce8a512695cc196948e..9c6fed2403aa4fa5a983d2cd48d822565dd03cb6 100644 (file)
@@ -585,17 +585,13 @@ int dict_attr_init(fr_dict_attr_t **da_p,
        switch (type) {
        case FR_TYPE_STRUCTURAL:
        structural:
-               if (type == FR_TYPE_GROUP) {
-                       if (dict_attr_ref_init(da_p) < 0) return -1;
-                       break;
-               }
+               if (dict_attr_ref_init(da_p) < 0) return -1;
 
                /*
-                *      TLVs and STRUCTs can refer to other TLVs and STRUCTs.
+                *      Groups don't have children or
+                *      namespaces.
                 */
-               if ((type == FR_TYPE_TLV) || (type == FR_TYPE_STRUCT)) {
-                       if (dict_attr_ref_init(da_p) < 0) return -1;
-               }
+               if (type == FR_TYPE_GROUP) break;
 
                if (dict_attr_children_init(da_p) < 0) return -1;
                if (dict_attr_namespace_init(da_p) < 0) return -1;      /* Needed for all TLV style attributes */