]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
use the correct cursor function instead of hand-rolling it
authorAlan T. DeKok <aland@freeradius.org>
Fri, 7 Jul 2023 16:56:41 +0000 (12:56 -0400)
committerAlan T. DeKok <aland@freeradius.org>
Mon, 10 Jul 2023 19:55:06 +0000 (15:55 -0400)
src/protocols/arp/base.c

index aca463d1709631a67dc75af24085a43bdc431688..8198f4e0f450843c86010e99664cec16e90caf23 100644 (file)
@@ -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