mirror of
https://github.com/FRRouting/frr.git
synced 2025-04-30 13:37:17 +02:00
Merge pull request #14894 from louis-6wind/bestpath-heap
bgpd: fix bgp_best_selection heap-use-after-free
This commit is contained in:
commit
e6e846de23
|
@ -2824,18 +2824,18 @@ void bgp_best_selection(struct bgp *bgp, struct bgp_dest *dest,
|
|||
/* reap REMOVED routes, if needs be
|
||||
* selected route must stay for a while longer though
|
||||
*/
|
||||
if (CHECK_FLAG(pi->flags, BGP_PATH_REMOVED) &&
|
||||
(pi != old_select)) {
|
||||
dest = bgp_path_info_reap(dest, pi);
|
||||
assert(dest);
|
||||
}
|
||||
|
||||
if (debug)
|
||||
zlog_debug(
|
||||
"%s: %pBD(%s) pi from %s in holddown",
|
||||
__func__, dest, bgp->name_pretty,
|
||||
pi->peer->host);
|
||||
|
||||
if (CHECK_FLAG(pi->flags, BGP_PATH_REMOVED) &&
|
||||
(pi != old_select)) {
|
||||
dest = bgp_path_info_reap(dest, pi);
|
||||
assert(dest);
|
||||
}
|
||||
|
||||
continue;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue