summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhilippe Guibert <philippe.guibert@6wind.com>2024-05-13 17:42:30 +0200
committerPhilippe Guibert <philippe.guibert@6wind.com>2024-05-13 18:00:50 +0200
commit42c497dec06b514d8bbf30ea01dea2601e82573c (patch)
treeb171d0f521a6dace47525c3e587bc8c088562362
parentb6f1b32c8a2423e3fbc5537cb8b53c065197b931 (diff)
bgpd: fix colored nexthops resolution
When the SR-TE service is off, colored BGP routes are not selected if it is recursively resolved over routes that are colored only. Actually, a BGP nexthop context includes the color attribute; when an update from ZEBRA is received, there is no color, and the colored BGP nexthop contexts are parsed, only if there is a non colored BGP nexthop context. The actual setup shows this may not be the case every time. Fix this by parsing all the colored BGP nexthop contexts. Fixes: b8210849b8ac ("bgpd: Make bgp ready to remove distinction between 2 nh tracking types") Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
-rw-r--r--bgpd/bgp_nht.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/bgpd/bgp_nht.c b/bgpd/bgp_nht.c
index 66d6a55683..fca3da9386 100644
--- a/bgpd/bgp_nht.c
+++ b/bgpd/bgp_nht.c
@@ -972,12 +972,12 @@ void bgp_nexthop_update(struct vrf *vrf, struct prefix *match,
* which should provide a better infrastructure to solve this issue in
* a more efficient and elegant way.
*/
- if (nhr->srte_color == 0 && bnc_nhc) {
+ if (nhr->srte_color == 0) {
struct bgp_nexthop_cache *bnc_iter;
frr_each (bgp_nexthop_cache, &bgp->nexthop_cache_table[afi],
bnc_iter) {
- if (!prefix_same(&bnc_nhc->prefix, &bnc_iter->prefix) ||
+ if (!prefix_same(match, &bnc_iter->prefix) ||
bnc_iter->srte_color == 0 ||
CHECK_FLAG(bnc_iter->flags, BGP_NEXTHOP_VALID))
continue;