]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
Amend fr_radius_next_encodable to suit fr_dcursor_t use
authorNick Porter <nick@portercomputing.co.uk>
Tue, 22 Dec 2020 18:02:00 +0000 (18:02 +0000)
committerArran Cudbard-Bell <a.cudbardb@freeradius.org>
Thu, 21 Jan 2021 23:05:49 +0000 (23:05 +0000)
src/protocols/radius/base.c
src/protocols/radius/encode.c

index 818315f93383a62f0514ea51c6134a3c9885fbc3..2aae250278d3bbfe83283ba5b914784bc574d0fd 100644 (file)
@@ -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;
 }
 
index 9a1f8b34f1566962505ea7d06f76321de0fb32c6..b1926953f1c445fd321c3de32833a0a9863d828f 100644 (file)
@@ -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