From: Nick Porter Date: Tue, 22 Dec 2020 18:02:00 +0000 (+0000) Subject: Amend fr_radius_next_encodable to suit fr_dcursor_t use X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ecde2bb7fed2f34e7f21a34c9921fb22c1809f3a;p=thirdparty%2Ffreeradius-server.git Amend fr_radius_next_encodable to suit fr_dcursor_t use --- diff --git a/src/protocols/radius/base.c b/src/protocols/radius/base.c index 818315f9338..2aae250278d 100644 --- a/src/protocols/radius/base.c +++ b/src/protocols/radius/base.c @@ -872,16 +872,16 @@ int fr_radius_verify(uint8_t *packet, uint8_t const *original, return 0; } -void *fr_radius_next_encodable(void **prev, void *to_eval, void *uctx); +void *fr_radius_next_encodable(fr_dlist_head_t *list, void *to_eval, void *uctx); -void *fr_radius_next_encodable(void **prev, void *to_eval, void *uctx) +void *fr_radius_next_encodable(fr_dlist_head_t *list, void *to_eval, void *uctx) { - fr_pair_t *c, *p; + fr_pair_t *c; fr_dict_t *dict = talloc_get_type_abort(uctx, fr_dict_t); if (!to_eval) return NULL; - for (p = *prev, c = to_eval; c; p = c, c = c->next) { + for (c = to_eval; c; c = fr_dlist_next(list, c)) { VP_VERIFY(c); if ((c->da->dict == dict) && (!c->da->flags.internal || ((c->da->attr > FR_TAG_BASE) && (c->da->attr < (FR_TAG_BASE + 0x20))))) { @@ -889,8 +889,6 @@ void *fr_radius_next_encodable(void **prev, void *to_eval, void *uctx) } } - *prev = p; - return c; } diff --git a/src/protocols/radius/encode.c b/src/protocols/radius/encode.c index 9a1f8b34f15..b1926953f1c 100644 --- a/src/protocols/radius/encode.c +++ b/src/protocols/radius/encode.c @@ -1481,7 +1481,7 @@ static ssize_t fr_radius_encode_proto(UNUSED TALLOC_CTX *ctx, fr_pair_list_t *vp /* * No one else should be using this. */ -extern void *fr_radius_next_encodable(void **prev, void *to_eval, void *uctx); +extern void *fr_radius_next_encodable(fr_dlist_head_t *list, void *to_eval, void *uctx); /* * Test points