]> git.puffer.fish Git - matthieu/frr.git/commitdiff
bgpd: bgp_process_main_one should ensure dest exists
authorDonald Sharp <sharpd@nvidia.com>
Sun, 10 Sep 2023 13:33:55 +0000 (09:33 -0400)
committerDonald Sharp <sharpd@nvidia.com>
Mon, 11 Sep 2023 16:45:59 +0000 (12:45 -0400)
Unsetting a flag after the dest has been possibly been
freed is not a good thing to do.  Ensure that this
is not possible.

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

index 34d36a63756fa01c990b2c3e49f23ac5cce90e86..7d0cc377bd513d49068610f924062ece4eef8cff 100644 (file)
@@ -3504,11 +3504,12 @@ static void bgp_process_main_one(struct bgp *bgp, struct bgp_dest *dest,
        /* Clear any route change flags. */
        bgp_zebra_clear_route_change_flags(dest);
 
+       UNSET_FLAG(dest->flags, BGP_NODE_PROCESS_SCHEDULED);
+
        /* Reap old select bgp_path_info, if it has been removed */
        if (old_select && CHECK_FLAG(old_select->flags, BGP_PATH_REMOVED))
                bgp_path_info_reap(dest, old_select);
 
-       UNSET_FLAG(dest->flags, BGP_NODE_PROCESS_SCHEDULED);
        return;
 }