]> git.puffer.fish Git - mirror/frr.git/commit
bgpd: When calling bgp_process, prevent infinite loop 17641/head
authorDonald Sharp <sharpd@nvidia.com>
Thu, 12 Dec 2024 20:08:35 +0000 (15:08 -0500)
committerDonald Sharp <sharpd@nvidia.com>
Thu, 12 Dec 2024 20:08:35 +0000 (15:08 -0500)
commit40c31bdf4092d45c23fc0e1eed9467015d224d2d
treebd945c214fc12048d9afee471294d9cf417cd507
parentf7720ab68fcfb24e7fa51f682d248086c45ef85a
bgpd: When calling bgp_process, prevent infinite loop

If we have this construct:

for (pi = bgp_dest_get_bgp_path_info(dest); pi; pi = pi->next) {
     ...
     bgp_process();
}

This can induce an infinite loop.  This happens because bgp_process
will move the unsorted items to the top of the list for handling,
as such it is necessary to hold the next pointer to the side
to actually look at each possible bgp_path_info.

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