From d826a734af340d12296ccb78cba73828ace66468 Mon Sep 17 00:00:00 2001 From: Mark Stapp Date: Tue, 12 Jun 2018 16:33:30 -0400 Subject: [PATCH] libs: add ALL_NEXTHOPS_PTR iterator macro Because sometimes we have a pointer to a nexthop_group. Signed-off-by: Mark Stapp --- lib/nexthop_group.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/nexthop_group.h b/lib/nexthop_group.h index a44f4e3542..473ecb34fc 100644 --- a/lib/nexthop_group.h +++ b/lib/nexthop_group.h @@ -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; -- 2.39.5