From: Alan T. DeKok Date: Fri, 7 Jul 2023 16:56:41 +0000 (-0400) Subject: use the correct cursor function instead of hand-rolling it X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=776fc1c44bf90d884d9228a287ed5a01b71f5f66;p=thirdparty%2Ffreeradius-server.git use the correct cursor function instead of hand-rolling it --- diff --git a/src/protocols/arp/base.c b/src/protocols/arp/base.c index aca463d1709..8198f4e0f45 100644 --- a/src/protocols/arp/base.c +++ b/src/protocols/arp/base.c @@ -158,13 +158,9 @@ ssize_t fr_arp_encode(fr_dbuff_t *dbuff, uint8_t const *original, fr_pair_list_t } /* - * Find the first attribute which is parented by ARP-Packet. + * Get a cursor over the ARP attributes. */ - for (vp = fr_pair_dcursor_init(&cursor, vps); - vp; - vp = fr_dcursor_next(&cursor)) { - if (vp->da->parent == attr_arp_packet) break; - } + vp = fr_pair_dcursor_by_ancestor_init(&cursor, vps, attr_arp_packet); /* * For simplicity, we allow the caller to omit things