]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
lists and attributes use the same code, but lists aren't attributes
authorAlan T. DeKok <aland@freeradius.org>
Wed, 16 Sep 2020 12:26:27 +0000 (08:26 -0400)
committerArran Cudbard-Bell <a.cudbardb@freeradius.org>
Mon, 21 Sep 2020 16:17:21 +0000 (11:17 -0500)
src/lib/server/tmpl.c

index b92b1e08e388e32f1e582ddf3d67df24915abd36..e1098e14ac28c91c34163fe5f568828712859af3 100644 (file)
@@ -3476,7 +3476,7 @@ ssize_t tmpl_attr_print(fr_sbuff_t *out, tmpl_t const *vpt, tmpl_attr_ref_prefix
         *      we add the .unknown prefix.
         *
         */
-       if (tmpl_contains_attr(vpt) && (ar = fr_dlist_tail(&vpt->data.attribute.ar))) {
+       if (!tmpl_is_list(vpt) && (ar = fr_dlist_tail(&vpt->data.attribute.ar))) {
                switch (ar->type) {
                case TMPL_ATTR_TYPE_NORMAL:
                case TMPL_ATTR_TYPE_UNKNOWN:
@@ -3494,7 +3494,7 @@ ssize_t tmpl_attr_print(fr_sbuff_t *out, tmpl_t const *vpt, tmpl_attr_ref_prefix
         *      Print attribute identifiers
         */
        while ((ar = fr_dlist_next(&vpt->data.attribute.ar, ar))) {
-               switch(ar->type) {
+               if (!tmpl_is_list(vpt)) switch(ar->type) {
                /*
                 *      For normal attributes we use the name
                 */