]> git.puffer.fish Git - mirror/frr.git/commitdiff
libs: add ALL_NEXTHOPS_PTR iterator macro 2650/head
authorMark Stapp <mjs@voltanet.io>
Tue, 12 Jun 2018 20:33:30 +0000 (16:33 -0400)
committerMark Stapp <mjs@voltanet.io>
Tue, 10 Jul 2018 18:07:43 +0000 (14:07 -0400)
Because sometimes we have a pointer to a nexthop_group.

Signed-off-by: Mark Stapp <mjs@voltanet.io>
lib/nexthop_group.h

index a44f4e35426e65f21b072d0347975d7a3fa43af5..473ecb34fc4df110bf0b3d27be0261f5e9a5ba21 100644 (file)
@@ -56,6 +56,11 @@ void copy_nexthops(struct nexthop **tnh, struct nexthop *nh,
        (nhop);                                                         \
        (nhop) = nexthop_next(nhop)
 
+#define ALL_NEXTHOPS_PTR(head, nhop)                                   \
+       (nhop) = ((head)->nexthop);                                     \
+       (nhop);                                                         \
+       (nhop) = nexthop_next(nhop)
+
 
 struct nexthop_hold {
        char *nhvrf_name;