]> git.puffer.fish Git - mirror/frr.git/commitdiff
bgpd: Process core when bgp instance is deleted 4499/head
authorSoman K S <somanks@vmware.com>
Tue, 11 Jun 2019 13:20:09 +0000 (06:20 -0700)
committerSoman K S <somanks@vmware.com>
Tue, 11 Jun 2019 13:20:09 +0000 (06:20 -0700)
* When the bgp is being deleted and routes are in clear workqueue
  and new aggregate address being allocated
* Added flag BGP_FLAG_DELETE_IN_PROGRESS in bgp structure to
  bgp instance is being  deleted
* When adding aggregate route check this flag and  peer_self is valid

Signed-off-by: Soman K S <somanks@vmware.com>
bgpd/bgp_route.c
bgpd/bgpd.c
bgpd/bgpd.h

index 4de73f1244190756099bde93e34f3524e77bf69a..c7188cdc785267e76798c8641907fe280b153489 100644 (file)
@@ -5787,6 +5787,13 @@ static void bgp_aggregate_route(struct bgp *bgp, struct prefix *p,
        unsigned long match = 0;
        uint8_t atomic_aggregate = 0;
 
+       /* If the bgp instance is being deleted or self peer is deleted
+        * then do not create aggregate route
+        */
+       if (bgp_flag_check(bgp, BGP_FLAG_DELETE_IN_PROGRESS) ||
+          (bgp->peer_self == NULL))
+               return;
+
        /* ORIGIN attribute: If at least one route among routes that are
           aggregated has ORIGIN with the value INCOMPLETE, then the
           aggregated route must have the ORIGIN attribute with the value
index 02eda7a430c4086168be691f4fbedf479bc923e3..181b3d70666016660a5d6b63141bf7f0ce4782db 100644 (file)
@@ -3287,6 +3287,9 @@ int bgp_delete(struct bgp *bgp)
        THREAD_OFF(bgp->t_update_delay);
        THREAD_OFF(bgp->t_establish_wait);
 
+       /* Set flag indicating bgp instance delete in progress */
+       bgp_flag_set(bgp, BGP_FLAG_DELETE_IN_PROGRESS);
+
        if (BGP_DEBUG(zebra, ZEBRA)) {
                if (bgp->inst_type == BGP_INSTANCE_TYPE_DEFAULT)
                        zlog_debug("Deleting Default VRF");
index 518f1f6714fdf2009b62a09eca10562a7be0e32c..dfece4d5e6325e12307e9abe219d2018fa242720 100644 (file)
@@ -361,6 +361,7 @@ struct bgp {
 #define BGP_FLAG_SHOW_HOSTNAME            (1 << 19)
 #define BGP_FLAG_GR_PRESERVE_FWD          (1 << 20)
 #define BGP_FLAG_GRACEFUL_SHUTDOWN        (1 << 21)
+#define BGP_FLAG_DELETE_IN_PROGRESS       (1 << 22)
 
        /* BGP Per AF flags */
        uint16_t af_flags[AFI_MAX][SAFI_MAX];