]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
Fix invalid test
authorArran Cudbard-Bell <a.cudbardb@freeradius.org>
Thu, 15 Dec 2022 02:23:34 +0000 (20:23 -0600)
committerArran Cudbard-Bell <a.cudbardb@freeradius.org>
Thu, 15 Dec 2022 02:23:34 +0000 (20:23 -0600)
src/lib/util/pair.c

index 626341f725ff4e68a2bd5256da6dd26f7a45b0ca..8c50817252465e02abb08238e80879ed8d5a1d12 100644 (file)
@@ -2841,8 +2841,6 @@ void fr_pair_verify(char const *file, int line, fr_pair_list_t const *list, fr_p
        }
 
        fr_dict_attr_verify(file, line, vp->da);
-       if (vp->data.enumv) fr_dict_attr_verify(file, line, vp->data.enumv);
-
        if (list) {
                fr_fatal_assert_msg(fr_pair_order_list_parent(vp) == &list->order,
                                    "CONSISTENCY CHECK FAILED %s[%u]:  pair does not have the correct parentage "
@@ -2850,6 +2848,13 @@ void fr_pair_verify(char const *file, int line, fr_pair_list_t const *list, fr_p
                                    file, line, vp->da->name);
        }
 
+       /*
+        *      This field is only valid for non-structural pairs
+        */
+       if (!fr_type_is_structural(vp->vp_type)) {
+               if (vp->data.enumv) fr_dict_attr_verify(file, line, vp->data.enumv);
+       }
+
        switch (vp->vp_type) {
        case FR_TYPE_OCTETS:
        {