Skip to content

Commit

Permalink
Merge pull request FRRouting#14218 from Pdoijode/pdoijode/frr-bgp-nex…
Browse files Browse the repository at this point in the history
…thop-find-fix

bgpd: Set ifindex to find the correct nexthop
  • Loading branch information
mjstapp authored Aug 17, 2023
2 parents bd6a00e + e06293c commit d50812e
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions bgpd/bgp_nht.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)) {
Expand Down

0 comments on commit d50812e

Please sign in to comment.