summaryrefslogtreecommitdiff
path: root/zebra
diff options
context:
space:
mode:
authorDonald Sharp <sharpd@cumulusnetworks.com>2021-10-18 13:49:35 -0400
committerDonald Sharp <sharpd@nvidia.com>2024-12-09 12:35:42 -0500
commitda7393b8fd67a6e0927af037dd263cc9d4e4b903 (patch)
tree2ca8135db5539703dc88fd5a8bc7f1e5fdd8cdfd /zebra
parent5fba3c4d74af2bc4156468e3d96b0f3ad971c993 (diff)
zebra: Fix another ships in the night issue with WFI
Effectively When bgp would send a route update down to zebra and immediately after that a asic update from the kernel was read. Zebra would choose the asic update and drop the bgp update leaving us in a state where bgp was not used as the true source. Modify the code so that in rib_multipath_nhe we notice that we have an unprocessed route update from bgp. And if so just drop this kernel update about an older version of the route since it is no longer needed. Ticket: 2722533 Signed-off-by: Donald Sharp <sharpd@nvidia.com>
Diffstat (limited to 'zebra')
-rw-r--r--zebra/zebra_rib.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/zebra/zebra_rib.c b/zebra/zebra_rib.c
index 574083ae02..11d279d8c9 100644
--- a/zebra/zebra_rib.c
+++ b/zebra/zebra_rib.c
@@ -2838,6 +2838,8 @@ static void process_subq_early_route_add(struct zebra_early_route *ere)
if (!ere->startup && (re->flags & ZEBRA_FLAG_SELFROUTE) &&
zrouter.asic_offloaded) {
+ struct route_entry *entry;
+
if (!same) {
if (IS_ZEBRA_DEBUG_RIB)
zlog_debug(
@@ -2854,6 +2856,25 @@ static void process_subq_early_route_add(struct zebra_early_route *ere)
early_route_memory_free(ere);
return;
}
+
+ RNODE_FOREACH_RE (rn, entry) {
+ if (CHECK_FLAG(entry->status, ROUTE_ENTRY_REMOVED))
+ continue;
+
+ if (entry->type != ere->re->type)
+ continue;
+
+ /*
+ * If we have an entry that is changed but un
+ * processed and not a self route, then
+ * we should just drop this new self route
+ */
+ if (CHECK_FLAG(entry->status, ROUTE_ENTRY_CHANGED) &&
+ !(entry->flags & ZEBRA_FLAG_SELFROUTE)) {
+ early_route_memory_free(ere);
+ return;
+ }
+ }
}
/* Set default distance by route type. */