diff options
author | vivek <vivek@cumulusnetworks.com> | 2021-03-21 21:39:51 +0100 |
---|---|---|
committer | Donald Sharp <sharpd@nvidia.com> | 2021-03-22 13:45:41 +0100 |
commit | 4115b2966b8aa6dfc29756035d694a785c88855f (patch) | |
tree | 6c3c796b14841f4a6f52a7ab41f85f6b0d72104d /bgpd/bgp_nht.c | |
parent | Merge pull request #8301 from donaldsharp/isis_spacing (diff) | |
download | frr-4115b2966b8aa6dfc29756035d694a785c88855f.tar.xz frr-4115b2966b8aa6dfc29756035d694a785c88855f.zip |
bgpd: Reset LLA NHT's interface if there is a change
For link-local IPv6 next hops, the next hop tracking is implemented based
on interface status changes. For this purpose, the ifindex is stored in
the NHT. Reset this value if a change in ifindex is noticed, such as for
example after a restart of the networking service.
Also add some additional debug logs.
Signed-off-by: Vivek Venkatraman <vivek@nvidia.com>
Updates: "bgpd: Switch LL nexthop tracking to be interface based"
Ticket: RM 2575386
Testing Done:
1. Manual verification
2. Precommit (#156), evpn-smoke (#155), bgp-smoke (#157), vrl (#158)
-- Precommit is clean, reported failures in evpn-smoke & vrl are resolved
-- some other tests fail in evpn-smoke, bgp-smoke & vrl, appear to be existing
-- or unrelated failures
Diffstat (limited to '')
-rw-r--r-- | bgpd/bgp_nht.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/bgpd/bgp_nht.c b/bgpd/bgp_nht.c index 0fea198cd..9c8d7878c 100644 --- a/bgpd/bgp_nht.c +++ b/bgpd/bgp_nht.c @@ -194,6 +194,16 @@ int bgp_find_or_add_nexthop(struct bgp *bgp_route, struct bgp *bgp_nexthop, bnc->srte_color, bnc->bgp->name_pretty, peer); } + } else { + if (BGP_DEBUG(nht, NHT)) { + char buf[PREFIX2STR_BUFFER]; + + zlog_debug( + "Found existing bnc %s(%s) flags 0x%x ifindex %d #paths %d peer %p", + bnc_str(bnc, buf, PREFIX2STR_BUFFER), + bnc->bgp->name_pretty, bnc->flags, bnc->ifindex, + bnc->path_count, bnc->nht_info); + } } if (is_bgp_static_route) { @@ -237,6 +247,11 @@ int bgp_find_or_add_nexthop(struct bgp *bgp_route, struct bgp *bgp_nexthop, UNSET_FLAG(bnc->flags, BGP_NEXTHOP_REGISTERED); UNSET_FLAG(bnc->flags, BGP_NEXTHOP_VALID); } + if (peer && (bnc->ifindex != ifindex)) { + UNSET_FLAG(bnc->flags, BGP_NEXTHOP_REGISTERED); + UNSET_FLAG(bnc->flags, BGP_NEXTHOP_VALID); + bnc->ifindex = ifindex; + } if (bgp_route->inst_type == BGP_INSTANCE_TYPE_VIEW) { SET_FLAG(bnc->flags, BGP_NEXTHOP_REGISTERED); SET_FLAG(bnc->flags, BGP_NEXTHOP_VALID); @@ -506,6 +521,11 @@ static int bgp_nht_ifp_initial(struct thread *thread) if (!ifp) return 0; + if (BGP_DEBUG(nht, NHT)) + zlog_debug( + "Handle NHT initial update for Intf %s(%d) status %s", + ifp->name, ifp->ifindex, if_is_up(ifp) ? "up" : "down"); + if (if_is_up(ifp)) bgp_nht_ifp_up(ifp); else |