]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
Amend fr_dhcpv6_next_encocable to work with dcursors
authorNick Porter <nick@portercomputing.co.uk>
Sat, 9 Jan 2021 15:39:46 +0000 (15:39 +0000)
committerArran Cudbard-Bell <a.cudbardb@freeradius.org>
Thu, 21 Jan 2021 23:05:49 +0000 (23:05 +0000)
src/protocols/dhcpv6/attrs.h
src/protocols/dhcpv6/base.c

index 315479392dd452e6f3a184370f1f7b1d8d4f054e..7e2cb63d9d87d21d15fa58459fd5426f8506cf5d 100644 (file)
@@ -40,4 +40,4 @@ extern fr_dict_attr_t const *attr_relay_message;
 /*
  *     A private function that is used only in base.c and encode.c
  */
-void *fr_dhcpv6_next_encodable(void **prev, void *to_eval, void *uctx);
+void *fr_dhcpv6_next_encodable(fr_dlist_head_t *list, void *to_eval, void *uctx);
index f72da920cf5c597c81fa150082e35790c9481333..90d99dee134e254dda585c01eb0437af85adc80c 100644 (file)
@@ -754,14 +754,14 @@ decode_options:
 /** DHCPV6-specific iterator
  *
  */
-void *fr_dhcpv6_next_encodable(void **prev, void *to_eval, void *uctx)
+void *fr_dhcpv6_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) continue;
                if (c->da->type == FR_TYPE_BOOL && !c->vp_bool) continue;
@@ -769,8 +769,6 @@ void *fr_dhcpv6_next_encodable(void **prev, void *to_eval, void *uctx)
                break;
        }
 
-       *prev = p;
-
        return c;
 }