]> git.proxmox.com Git - mirror_frr.git/commitdiff
bgpd: Fix for BGP core when connected routes are redistributed
authorbisdhdh <biswajit.sadhu@gmail.com>
Wed, 23 Oct 2019 19:15:43 +0000 (00:45 +0530)
committerbisdhdh <biswajit.sadhu@gmail.com>
Thu, 23 Jan 2020 04:04:25 +0000 (09:34 +0530)
& 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>
bgpd/bgp_route.c

index e58158957df52c787e2f4ae93ff5ded261d2c1a7..75963def864e93378058fa2bb62593607c35aed8 100644 (file)
@@ -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;