]> git.puffer.fish Git - mirror/frr.git/commitdiff
bgpd: bgp_best_selection ensure dest still exists
authorDonald Sharp <sharpd@nvidia.com>
Sun, 10 Sep 2023 13:51:34 +0000 (09:51 -0400)
committerDonald Sharp <sharpd@nvidia.com>
Mon, 11 Sep 2023 16:45:59 +0000 (12:45 -0400)
When reaping the dest ensure that it still exists as that
it should be locked by the calling function.

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

index d745f8cb78526442a71f3ff6fab04b52edb78c8d..367398e5fd5a4fc078e354513659f817ced0f0f2 100644 (file)
@@ -2815,9 +2815,11 @@ 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))
-                               bgp_path_info_reap(dest, pi);
+                       if (CHECK_FLAG(pi->flags, BGP_PATH_REMOVED) &&
+                           (pi != old_select)) {
+                               dest = bgp_path_info_reap(dest, pi);
+                               assert(dest);
+                       }
 
                        if (debug)
                                zlog_debug(