]> git.puffer.fish Git - mirror/frr.git/commitdiff
bgpd: Both possible paths unset a flag, so reduce
authorDonald Sharp <sharpd@nvidia.com>
Sun, 25 Feb 2024 12:59:25 +0000 (07:59 -0500)
committerDonald Sharp <sharpd@nvidia.com>
Sun, 3 Mar 2024 02:05:46 +0000 (21:05 -0500)
Both paths through the code unset a flag, so reduce the
duplication.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
bgpd/bgp_route.c

index 6c2fa91cfa96808aaae60faec27543f9f76d2944..54ab15a9f1ddd0f6540b08653f4e7a54dce65740 100644 (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,