]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
simplify code.
authorAlan T. DeKok <aland@freeradius.org>
Thu, 1 Dec 2022 21:55:52 +0000 (16:55 -0500)
committerAlan T. DeKok <aland@freeradius.org>
Thu, 1 Dec 2022 21:57:37 +0000 (16:57 -0500)
xlat's have not been supported for a while.  So there's no reason
to manually root through the list looking for things.

src/bin/radclient.c

index 287d187d0fb808e994740a81d729ea1d20145978..58e118b108a284fdd42af29dfb4e142d2ac4bb4f 100644 (file)
@@ -425,22 +425,10 @@ static int radclient_init(TALLOC_CTX *ctx, rc_file_pair_t *files)
                                goto error;
                        }
 
-                       /*
-                        *      xlat expansions aren't supported here
-                        */
-                       for (vp = fr_pair_list_head(&request->filter);
-                            vp;
-                            vp = fr_pair_list_next(&request->filter, vp)) {
-                            again:
-                               if (vp->da == attr_packet_type) {
-                                       fr_pair_t *next;
-                                       next = fr_pair_list_next(&request->filter, vp); /* so we don't break the filter */
-                                       request->filter_code = vp->vp_uint32;
-                                       fr_pair_delete(&request->filter, vp);
-                                       vp = next;
-                                       if (!vp) break;
-                                       goto again;
-                               }
+                       vp = fr_pair_find_by_da(&request->filter, NULL, attr_packet_type);
+                       if (vp) {
+                               request->filter_code = vp->vp_uint32;
+                               fr_pair_delete(&request->filter, vp);
                        }
 
                        /*