]> git.puffer.fish Git - mirror/frr.git/commitdiff
bgpd: Simplify for loop 15467/head
authorDonald Sharp <sharpd@nvidia.com>
Sun, 25 Feb 2024 13:07:21 +0000 (08:07 -0500)
committerDonald Sharp <sharpd@nvidia.com>
Sun, 3 Mar 2024 02:05:46 +0000 (21:05 -0500)
This for loop has no chance of removing entries so there is no
need to do a bit of complicated code to handle the case where
an entry can be removed.

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

index c91745030da801e2c36fb2ac7a650429322b7e75..45951e9ea88ce8ef3bdefeccaa5bb073a9ffd93d 100644 (file)
@@ -2907,9 +2907,7 @@ void bgp_best_selection(struct bgp *bgp, struct bgp_dest *dest,
        }
 
        if (do_mpath && new_select) {
-               for (pi = bgp_dest_get_bgp_path_info(dest);
-                    (pi != NULL) && (nextpi = pi->next, 1); pi = nextpi) {
-
+               for (pi = bgp_dest_get_bgp_path_info(dest); pi; pi = pi->next) {
                        if (debug)
                                bgp_path_info_path_with_addpath_rx_str(
                                        pi, path_buf, sizeof(path_buf));