*/
static bool rnh_nexthop_valid(const struct nexthop *nh)
{
- return ((CHECK_FLAG(nh->flags, NEXTHOP_FLAG_FIB)
- || CHECK_FLAG(nh->flags, NEXTHOP_FLAG_RECURSIVE))
+ return (CHECK_FLAG(nh->flags, NEXTHOP_FLAG_FIB)
&& CHECK_FLAG(nh->flags, NEXTHOP_FLAG_ACTIVE));
}
/* Just being SELECTED isn't quite enough - must
* have an installed nexthop to be useful.
*/
- for (nexthop = re->ng.nexthop; nexthop;
- nexthop = nexthop->next) {
+ for (ALL_NEXTHOPS(re->ng, nexthop)) {
if (rnh_nexthop_valid(nexthop))
break;
}
num = 0;
nump = stream_get_endp(s);
stream_putc(s, 0);
- for (nh = re->ng.nexthop; nh; nh = nh->next)
+ for (ALL_NEXTHOPS(re->ng, nh))
if (rnh_nexthop_valid(nh)) {
stream_putl(s, nh->vrf_id);
stream_putc(s, nh->type);