diff options
author | Mark Stapp <mjs@labn.net> | 2023-06-28 14:11:41 +0200 |
---|---|---|
committer | Mark Stapp <mjs@labn.net> | 2023-07-10 22:43:53 +0200 |
commit | bb58cad150cd626a780b091b61a2d2ca6235e1e3 (patch) | |
tree | f48800bbe1f713261b4bbc96fdf0904fcc7bfb47 /zebra/zebra_nhg.c | |
parent | nhrpd: clean up locals in route zapi api (diff) | |
download | frr-bb58cad150cd626a780b091b61a2d2ca6235e1e3.tar.xz frr-bb58cad150cd626a780b091b61a2d2ca6235e1e3.zip |
zebra: use NHRP routes as valid in nexthop check
Treat NHRP-installed routes as valid, as if they were
CONNECTED routes, when checking candidate routes'
nexthops for validity. This allows use of NHRP by an
IGP, for example, that doesn't normally want recursive
nexthop resolution.
Signed-off-by: Mark Stapp <mjs@labn.net>
Diffstat (limited to '')
-rw-r--r-- | zebra/zebra_nhg.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/zebra/zebra_nhg.c b/zebra/zebra_nhg.c index e44f6ee4e..bb507893b 100644 --- a/zebra/zebra_nhg.c +++ b/zebra/zebra_nhg.c @@ -2392,7 +2392,10 @@ static int nexthop_active(struct nexthop *nexthop, struct nhg_hash_entry *nhe, continue; } - if ((match->type == ZEBRA_ROUTE_CONNECT) || + /* If the candidate match's type is considered "connected", + * we consider it first. + */ + if (RIB_CONNECTED_ROUTE(match) || (RIB_SYSTEM_ROUTE(match) && RSYSTEM_ROUTE(type))) { match = zebra_nhg_connected_ifindex(rn, match, nexthop->ifindex); @@ -2413,6 +2416,10 @@ static int nexthop_active(struct nexthop *nexthop, struct nhg_hash_entry *nhe, return 0; } + /* NHRP special case: need to indicate onlink */ + if (match->type == ZEBRA_ROUTE_NHRP) + SET_FLAG(nexthop->flags, NEXTHOP_FLAG_ONLINK); + if (IS_ZEBRA_DEBUG_NHG_DETAIL) zlog_debug( "%s: CONNECT match %p (%pNG), newhop %pNHv", |