Merge pull request #14218 from Pdoijode/pdoijode/frr-bgp-nexthop-find-fix

bgpd: Set ifindex to find the correct nexthop
This commit is contained in:
Mark Stapp 2023-08-17 09:56:36 -04:00 committed by GitHub
commit d50812edb0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -316,6 +316,14 @@ int bgp_find_or_add_nexthop(struct bgp *bgp_route, struct bgp *bgp_nexthop,
if (make_prefix(afi, pi, &p) < 0)
return 1;
/*
* If path is learnt from an interface based peer,
* set the ifindex to peer's interface index so that
* correct nexthop can be found in nexthop tree.
*/
if (pi->peer->conf_if)
ifindex = pi->peer->su.sin6.sin6_scope_id;
if (!is_bgp_static_route && orig_prefix
&& prefix_same(&p, orig_prefix)) {
if (BGP_DEBUG(nht, NHT)) {