File tree Expand file tree Collapse file tree 2 files changed +12
-3
lines changed Expand file tree Collapse file tree 2 files changed +12
-3
lines changed Original file line number Diff line number Diff line change @@ -101,7 +101,7 @@ inline struct bgp_dest *bgp_dest_unlock_node(struct bgp_dest *dest)
101101 * bgp_node_destroy
102102 */
103103static void bgp_node_destroy (route_table_delegate_t * delegate ,
104- struct route_table * table , struct route_node * node )
104+ struct route_table * table , struct route_node * node )
105105{
106106 struct bgp_dest * dest ;
107107 struct bgp_table * rt ;
@@ -110,8 +110,8 @@ static void bgp_node_destroy(route_table_delegate_t *delegate,
110110 if (dest ) {
111111 if (rt -> bgp ) {
112112 bgp_addpath_free_node_data (& rt -> bgp -> tx_addpath ,
113- & dest -> tx_addpath ,
114- rt -> afi , rt -> safi );
113+ & dest -> tx_addpath ,
114+ rt -> afi , rt -> safi );
115115 }
116116 XFREE (MTYPE_BGP_NODE , dest );
117117 node -> info = NULL ;
Original file line number Diff line number Diff line change @@ -4205,6 +4205,15 @@ int bgp_delete(struct bgp *bgp)
42054205 event_cancel (& bgp -> t_maxmed_onstartup );
42064206 event_cancel (& bgp -> t_update_delay );
42074207 event_cancel (& bgp -> t_establish_wait );
4208+
4209+ /* If the clearing event is scheduled, there's an extra ref to
4210+ * this 'bgp' - ensure we unlock.
4211+ */
4212+ if (event_is_scheduled (bgp -> clearing_end )) {
4213+ assert (bgp -> lock > 1 );
4214+ bgp_unlock (bgp );
4215+ }
4216+
42084217 event_cancel (& bgp -> clearing_end );
42094218
42104219 /* Set flag indicating bgp instance delete in progress */
You can’t perform that action at this time.
0 commit comments