summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorbisdhdh <biswajit.sadhu@gmail.com>2019-10-23 21:15:43 +0200
committerbisdhdh <biswajit.sadhu@gmail.com>2020-01-23 05:04:25 +0100
commit5f9c1aa29eab6052403fdf2df2c1d7c543da687c (patch)
tree60c637c9dba06abf742ee7776b525f47bcd9c76c
parentbgpd: Adding BGP GR change mode config apply on notification sent & received. (diff)
downloadfrr-5f9c1aa29eab6052403fdf2df2c1d7c543da687c.tar.xz
frr-5f9c1aa29eab6052403fdf2df2c1d7c543da687c.zip
bgpd: Fix for BGP core when connected routes are redistributed
& GR is enabled. When GR with deferral is enabled and connected routes are distributed then in one race condition route node gets added in to both deferred queue and work queue. If deferred queue gets processed first then it ends up delete only flag while leaving the entry in the work queue as it is. When a new update comes for the same route node next time from peer then it hits assert. Assert check is added to ensure we don’t add to work queue again while it is already present. So, check before adding in to deferred queue if it is already present in work queue and bail if so. Signed-off-by: Biswajit Sadhu <sadhub@vmware.com>
-rw-r--r--bgpd/bgp_route.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/bgpd/bgp_route.c b/bgpd/bgp_route.c
index e58158957..75963def8 100644
--- a/bgpd/bgp_route.c
+++ b/bgpd/bgp_route.c
@@ -314,6 +314,15 @@ static int bgp_node_set_defer_flag(struct bgp_node *rn, bool delete)
if (CHECK_FLAG(rn->flags, BGP_NODE_SELECT_DEFER) && (delete == false))
return 0;
+ if (CHECK_FLAG(rn->flags, BGP_NODE_PROCESS_SCHEDULED)) {
+ if (BGP_DEBUG(update, UPDATE_OUT)) {
+ prefix2str(&rn->p, buf, PREFIX2STR_BUFFER);
+ zlog_debug("Route %s is in workqueue and being processed, not deferred.",
+ buf);
+ }
+ return 0;
+ }
+
table = bgp_node_table(rn);
if (table) {
bgp = table->bgp;