diff options
| author | Mark Stapp <mjs.ietf@gmail.com> | 2023-08-17 09:56:36 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-08-17 09:56:36 -0400 |
| commit | d50812edb0d0d2a61fbce0447aadb03552d2ef1c (patch) | |
| tree | 9009b7a95c882eee9f9561f6ac3ff5b8416ee2a7 | |
| parent | bd6a00e8f7ab48e6ab20673474c6eb1e879cb5c4 (diff) | |
| parent | e06293c395f7eb33927b29ceaae33b703058d242 (diff) | |
Merge pull request #14218 from Pdoijode/pdoijode/frr-bgp-nexthop-find-fix
bgpd: Set ifindex to find the correct nexthop
| -rw-r--r-- | bgpd/bgp_nht.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/bgpd/bgp_nht.c b/bgpd/bgp_nht.c index bbc30365c7..733dcc72a2 100644 --- a/bgpd/bgp_nht.c +++ b/bgpd/bgp_nht.c @@ -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)) { |
