summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRuss White <russ@riw.us>2018-12-13 10:35:58 -0500
committerGitHub <noreply@github.com>2018-12-13 10:35:58 -0500
commitf1663c1eaefed315a6e614a5ecfccbf6ca0286b5 (patch)
tree46b111481d1223d9af3231177b232f8f2a2311c3
parenteefe8ab766d39909a8a0e65c369d769ad950f5f4 (diff)
parent72366a6e970aca525098c8cb17090e5264c5729c (diff)
Merge pull request #3466 from donaldsharp/fib_only
zebra: For rnh handling use actual resolved nexthop
-rw-r--r--zebra/zebra_rnh.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/zebra/zebra_rnh.c b/zebra/zebra_rnh.c
index e92cd8bb8a..b1fbe8a653 100644
--- a/zebra/zebra_rnh.c
+++ b/zebra/zebra_rnh.c
@@ -528,8 +528,7 @@ static void zebra_rnh_process_pbr_tables(int family,
*/
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));
}
@@ -581,8 +580,7 @@ zebra_rnh_resolve_nexthop_entry(struct zebra_vrf *zvrf, int family,
/* 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;
}
@@ -915,7 +913,7 @@ static int send_client(struct rnh *rnh, struct zserv *client, rnh_type_t type,
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);