]> git.proxmox.com Git - mirror_frr.git/commitdiff
bgpd: handle additional events occuring during instance shutdown
authorLou Berger <lberger@labn.net>
Thu, 13 Jun 2019 20:35:57 +0000 (20:35 +0000)
committerLou Berger <lberger@labn.net>
Tue, 18 Jun 2019 11:54:52 +0000 (11:54 +0000)
Signed-off-by: Lou Berger <lberger@labn.net>
bgpd/bgp_route.c
bgpd/rfapi/rfapi_import.c

index c7188cdc785267e76798c8641907fe280b153489..1e028342c0db804ca8184d167d54c9396b007afd 100644 (file)
@@ -2310,6 +2310,17 @@ static void bgp_process_main_one(struct bgp *bgp, struct bgp_node *rn,
        char pfx_buf[PREFIX2STR_BUFFER];
        int debug = 0;
 
+       if (bgp_flag_check(bgp, BGP_FLAG_DELETE_IN_PROGRESS)) {
+               if (rn)
+                       debug = bgp_debug_bestpath(&rn->p);
+               if (debug) {
+                       prefix2str(&rn->p, pfx_buf, sizeof(pfx_buf));
+                       zlog_debug(
+                            "%s: bgp delete in progress, ignoring event, p=%s",
+                            __func__, pfx_buf);
+               }
+               return;
+       }
        /* Is it end of initial update? (after startup) */
        if (!rn) {
                quagga_timestamp(3, bgp->update_delay_zebra_resume_time,
index 583adcda77cc17bf98b4ff3b68e78d588f5c8c46..87a05a4f8c12da32980638b13c4ffed218c03b14 100644 (file)
@@ -2402,6 +2402,18 @@ static int rfapiWithdrawTimerVPN(struct thread *t)
        struct rfapi_monitor_vpn *moved;
        afi_t afi;
 
+       if (bgp == NULL) {
+               vnc_zlog_debug_verbose(
+                   "%s: NULL BGP pointer, assume shutdown race condition!!!",
+                   __func__);
+               return 0;
+       }
+       if (bgp_flag_check(bgp, BGP_FLAG_DELETE_IN_PROGRESS)) {
+               vnc_zlog_debug_verbose(
+                   "%s: BGP delete in progress, assume shutdown race condition!!!",
+                   __func__);
+               return 0;
+       }
        assert(wcb->node);
        assert(bpi);
        assert(wcb->import_table);