From 09496b35ed5dcdcdaba4ecda49aa9e691db29426 Mon Sep 17 00:00:00 2001 From: "Alan T. DeKok" Date: Thu, 1 Dec 2022 16:55:52 -0500 Subject: [PATCH] simplify code. 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 | 20 ++++---------------- 1 file changed, 4 insertions(+), 16 deletions(-) diff --git a/src/bin/radclient.c b/src/bin/radclient.c index 287d187d0fb..58e118b108a 100644 --- a/src/bin/radclient.c +++ b/src/bin/radclient.c @@ -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); } /* -- 2.47.3