Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bgpd: Process core when bgp instance is deleted #4499

Merged
merged 1 commit into from
Jun 13, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 @@ -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];
Expand Down