]> git.puffer.fish Git - matthieu/frr.git/commitdiff
bgpd: With suppress-fib-pending ensure withdrawal is sent
authorDonald Sharp <sharpd@nvidia.com>
Fri, 31 Jan 2025 23:53:30 +0000 (18:53 -0500)
committerMergify <37929162+mergify[bot]@users.noreply.github.com>
Sat, 1 Feb 2025 11:26:53 +0000 (11:26 +0000)
When you have suppress-fib-pending turned on it is possible
to end up in a situation where the prefix is not withdrawn
from downstream peers.

Here is the timing that I believe is happening:

a) have 2 paths to a peer.
b) receive a withdrawal from 1 path, set BGP_NODE_FIB_INSTALL_PENDING
   and send the route install to zebra.
c) receive a withdrawal from the other path.
d) At this point we have a dest->flags set BGP_NODE_FIB_INSTALL_PENDING
   old_select the path_info going away, new_select is NULL
e) A bit further down we call group_announce_route() which calls
   the code to see if we should advertise the path.  It sees the
   BGP_NODE_FIB_INSTALL_PENDING flag and says, nope.
f) the route is sent to zebra to withdraw, which unsets the
   BGP_NODE_FIB_INSTALL_PENDING.
g) This function winds up and deletes the path_info.  Dest now
   has no path infos.
h) BGP receives the route install(from step b) and unsets the
   BGP_NODE_FIB_INSTALL_PENDING flag
i) BGP receives the route removed from zebra (from step f) and
   unsets the flag again.

We know if there is no new_select, let's go ahead and just
unset the PENDING flag to allow the withdrawal to go out
at the time when the second withdrawal is received.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
(cherry picked from commit 4e8eda74ec7d30ba84e7f53f077f4b896728505a)

bgpd/bgp_route.c

index c61462f2becd74a3a86004c0eb663ccde102a9e2..e70ebabc356535dbb0da14f6b6f0664314507dcd 100644 (file)
@@ -3806,6 +3806,12 @@ static void bgp_process_main_one(struct bgp *bgp, struct bgp_dest *dest,
                                         BGP_PATH_ATTR_CHANGED);
                UNSET_FLAG(new_select->flags, BGP_PATH_MULTIPATH_CHG);
                UNSET_FLAG(new_select->flags, BGP_PATH_LINK_BW_CHG);
+       } else {
+               /*
+                * Ensure that on uninstall that the INSTALL_PENDING
+                * is no longer set
+                */
+               UNSET_FLAG(dest->flags, BGP_NODE_FIB_INSTALL_PENDING);
        }
 
        /* call bmp hook for loc-rib route update / withdraw after flags were