Skip to content

Commit

Permalink
Merge pull request #4499 from kssoman/core
Browse files Browse the repository at this point in the history
bgpd: Process core when bgp instance is deleted
  • Loading branch information
louberger authored Jun 13, 2019
2 parents 0688fd8 + 9f822fa commit 5beabde
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 0 deletions.
7 changes: 7 additions & 0 deletions bgpd/bgp_route.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 3 additions & 0 deletions bgpd/bgpd.c
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down
1 change: 1 addition & 0 deletions bgpd/bgpd.h
Original file line number Diff line number Diff line change
Expand Up @@ -362,6 +362,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];
Expand Down

0 comments on commit 5beabde

Please sign in to comment.