]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
Remove tmpl_s.data.attribute.list
authorArran Cudbard-Bell <a.cudbardb@freeradius.org>
Thu, 9 Feb 2023 18:38:15 +0000 (12:38 -0600)
committerArran Cudbard-Bell <a.cudbardb@freeradius.org>
Thu, 9 Feb 2023 18:41:09 +0000 (12:41 -0600)
The list is now identified by the first attr ref

src/lib/server/tmpl.h
src/lib/server/tmpl_tokenize.c

index 4a9e3aa3e5ec1e8cdad640a542f825b70325c5a6..eb35a8bdd13e6f351f6bed86137091213215f3a5 100644 (file)
@@ -562,9 +562,6 @@ struct tmpl_s {
                                                                ///< with a '&'.
                        bool                    was_oid;        //!< Was originally a numeric OID.
 
-                       fr_dict_attr_t const    *list;          //!< List to search or insert in.
-                                                               ///< deprecated.
-
                        FR_DLIST_HEAD(tmpl_request_list)        rr;     //!< Request to search or insert in.
                        FR_DLIST_HEAD(tmpl_attr_list)           ar;     //!< Head of the attribute reference list.
                } attribute;
@@ -894,10 +891,9 @@ static inline size_t tmpl_attr_num_elements(tmpl_t const *vpt)
 
 static inline fr_dict_attr_t const *tmpl_list(tmpl_t const *vpt)
 {
-       tmpl_assert_type(tmpl_is_attr(vpt) ||
-                        tmpl_is_attr_unresolved(vpt));
+       if (!tmpl_attr_head_is_list(vpt)) return NULL;
 
-       return vpt->data.attribute.list;
+       return tmpl_attr_list_head(tmpl_attr(vpt))->ar_da;
 }
 /** @} */
 
index a6a26e84195d48a214f6edce452a3c351eb4b617..29ffd129911fa357d58d23f9db542892bac7a45c 100644 (file)
@@ -297,7 +297,7 @@ void tmpl_attr_debug(tmpl_t const *vpt)
                i++;
        }
 
-       FR_FAULT_LOG("list: %s", tmpl_list_name(vpt->data.attribute.list, "<INVALID>"));
+       FR_FAULT_LOG("list: %s", tmpl_list_name(tmpl_list(vpt), "<INVALID>"));
        tmpl_attr_ref_list_debug(tmpl_attr(vpt));
 }
 
@@ -1084,11 +1084,6 @@ int tmpl_attr_copy(tmpl_t *dst, tmpl_t const *src)
        tmpl_request_list_talloc_reverse_free(&dst->data.attribute.rr);
        tmpl_request_ref_list_copy(dst, &dst->data.attribute.rr, &src->data.attribute.rr);
 
-       /*
-        *      Remove me...
-        */
-       dst->data.attribute.list = src->data.attribute.list;
-
        TMPL_ATTR_VERIFY(dst);
 
        return 0;
@@ -1250,7 +1245,6 @@ void tmpl_attr_set_request_ref(tmpl_t *vpt, FR_DLIST_HEAD(tmpl_request_list) con
 void tmpl_attr_set_list(tmpl_t *vpt, fr_dict_attr_t const *list)
 {
        tmpl_attr_t *ref = tmpl_attr_list_head(tmpl_attr(vpt));
-       vpt->data.attribute.list = list;
        if (tmpl_attr_is_list_attr(ref)) ref->da = list;
 
        TMPL_ATTR_VERIFY(vpt);
@@ -2163,7 +2157,6 @@ ssize_t tmpl_afrom_attr_substr(TALLOC_CTX *ctx, tmpl_attr_error_t *err,
                 *      first.
                 */
                tmpl_attr_list_insert_head(tmpl_attr(vpt), ar);
-               vpt->data.attribute.list = ar->ar_da;
        }
 
        tmpl_set_name(vpt, T_BARE_WORD, fr_sbuff_start(&our_name), fr_sbuff_used(&our_name));
@@ -2199,8 +2192,6 @@ ssize_t tmpl_afrom_attr_substr(TALLOC_CTX *ctx, tmpl_attr_error_t *err,
                fr_assert(ar != NULL);
 
                if (tmpl_attr_is_list_attr(ar)) vpt->rules.attr.list_def = ar->ar_da;
-
-               vpt->data.attribute.list = vpt->rules.attr.list_def;
        }
 
        if (!tmpl_substr_terminal_check(&our_name, p_rules)) {