diff options
author | Maria Matejka <mq@ucw.cz> | 2022-08-03 14:07:53 +0200 |
---|---|---|
committer | Maria Matejka <mq@ucw.cz> | 2022-08-03 14:07:53 +0200 |
commit | 5a96b9b12496082b9d6165f51597403546ed617d (patch) | |
tree | 41f7e773ee776bea66d306a0f546ae148aa37054 /proto/bgp/bgp.c | |
parent | 71b434a987067475b517792360f58dbe03bfee9e (diff) | |
parent | 97476e002d7dfb24a4613ac401b8f3192ca68d05 (diff) |
Merge commit '97476e00' into thread-next
Had to fix route source locking inside BGP export table as we need to
keep the route sources properly allocated until even last BGP pending
update is sent out, therefore the export table printout is accurate.
Diffstat (limited to 'proto/bgp/bgp.c')
-rw-r--r-- | proto/bgp/bgp.c | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/proto/bgp/bgp.c b/proto/bgp/bgp.c index d240112c..65673e37 100644 --- a/proto/bgp/bgp.c +++ b/proto/bgp/bgp.c @@ -518,6 +518,12 @@ bgp_stop(struct bgp_proto *p, int subcode, byte *data, uint len) p->uncork_ev->data = NULL; bgp_graceful_close_conn(&p->outgoing_conn, subcode, data, len); bgp_graceful_close_conn(&p->incoming_conn, subcode, data, len); + + struct bgp_channel *c; + WALK_LIST(c, p->p.channels) + if (c->ptx) + bgp_free_pending_tx(c); + ev_schedule(p->event); } @@ -787,10 +793,8 @@ bgp_handle_graceful_restart(struct bgp_proto *p) } /* Reset bucket and prefix tables */ - bgp_free_bucket_table(c); - bgp_free_prefix_table(c); - bgp_init_bucket_table(c); - bgp_init_prefix_table(c); + bgp_free_pending_tx(c); + bgp_init_pending_tx(c); c->packets_to_send = 0; } @@ -1806,8 +1810,7 @@ bgp_channel_start(struct channel *C) if (c->cf->export_table) bgp_setup_out_table(c); - bgp_init_bucket_table(c); - bgp_init_prefix_table(c); + bgp_init_pending_tx(c); c->stale_timer = tm_new_init(c->pool, bgp_long_lived_stale_timeout, c, 0, 0); |