bgpd: Both possible paths unset a flag, so reduce

Both paths through the code unset a flag, so reduce the
duplication.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
This commit is contained in:
Donald Sharp 2024-02-25 07:59:25 -05:00
parent b56758dae8
commit 4d307c9914

View File

@ -2866,9 +2866,10 @@ void bgp_best_selection(struct bgp *bgp, struct bgp_dest *dest,
continue;
}
if (CHECK_FLAG(bgp->flags, BGP_FLAG_DETERMINISTIC_MED)
&& (!CHECK_FLAG(pi->flags, BGP_PATH_DMED_SELECTED))) {
bgp_path_info_unset_flag(dest, pi, BGP_PATH_DMED_CHECK);
bgp_path_info_unset_flag(dest, pi, BGP_PATH_DMED_CHECK);
if (CHECK_FLAG(bgp->flags, BGP_FLAG_DETERMINISTIC_MED) &&
(!CHECK_FLAG(pi->flags, BGP_PATH_DMED_SELECTED))) {
if (debug)
zlog_debug("%s: %pBD(%s) pi %s dmed", __func__,
dest, bgp->name_pretty,
@ -2876,8 +2877,6 @@ void bgp_best_selection(struct bgp *bgp, struct bgp_dest *dest,
continue;
}
bgp_path_info_unset_flag(dest, pi, BGP_PATH_DMED_CHECK);
reason = dest->reason;
if (bgp_path_info_cmp(bgp, pi, new_select, &paths_eq, mpath_cfg,
debug, pfx_buf, afi, safi,