From 4d307c991427f40f1481ee938db5d8328f07a5f0 Mon Sep 17 00:00:00 2001 From: Donald Sharp Date: Sun, 25 Feb 2024 07:59:25 -0500 Subject: [PATCH] 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 --- bgpd/bgp_route.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/bgpd/bgp_route.c b/bgpd/bgp_route.c index 6c2fa91cfa..54ab15a9f1 100644 --- a/bgpd/bgp_route.c +++ b/bgpd/bgp_route.c @@ -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,