diff --git a/bgpd/bgp_route.c b/bgpd/bgp_route.c index fd20a7914aae..3fdef01fe0ba 100644 --- a/bgpd/bgp_route.c +++ b/bgpd/bgp_route.c @@ -3423,6 +3423,9 @@ static void bgp_process_main_one(struct bgp *bgp, struct bgp_dest *dest, * set */ if (old_select || new_select) { + if (old_select) + bgp_path_info_lock(old_select); + hook_call(bgp_route_update, bgp, afi, safi, dest, old_select, new_select); } @@ -3614,6 +3617,7 @@ static void bgp_process_main_one(struct bgp *bgp, struct bgp_dest *dest, old_select->peer->stat_loc_rib_count[afi][safi]--; hook_call(bgp_process_main_one_end, bgp, old_select); + bgp_path_info_unlock(old_select); } if (new_select && new_select->peer) @@ -3634,7 +3638,6 @@ static void bgp_process_main_one(struct bgp *bgp, struct bgp_dest *dest, } bgp_mpath_diff_clear(&mpath_diff); bgp_mpath_diff_fini(&mpath_diff); - return; } /* Process the routes with the flag BGP_NODE_SELECT_DEFER set */