]> git.puffer.fish Git - matthieu/frr.git/commitdiff
bgpd: Wait for Install should not always set the flag
authorDonald Sharp <sharpd@nvidia.com>
Mon, 1 Mar 2021 18:09:11 +0000 (13:09 -0500)
committerDonald Sharp <sharpd@nvidia.com>
Mon, 1 Mar 2021 18:09:11 +0000 (13:09 -0500)
If we are filtering a route due to any of the filter reasons
we should not be setting the BGP_NODE_FIB_INSTALL_FIB_PENDING
flag.  This is especially evident with say a loopback that
is covered by a network statement.  When we receive the route
back from our peer we should not be setting the
BGP_NODE_FIB_INSTALL_PENDING flag on it.

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

index 18a0b3fb7d45b11e8d44481a178bcdaeb2386932..d7a4a4363340e29546c237f55848ddf92c53c9f8 100644 (file)
@@ -3597,19 +3597,6 @@ int bgp_update(struct peer *peer, const struct prefix *p, uint32_t addpath_id,
        if (has_valid_label)
                assert(label != NULL);
 
-       /* The flag BGP_NODE_FIB_INSTALL_PENDING is for the following
-        * condition :
-        * Suppress fib is enabled
-        * BGP_OPT_NO_FIB is not enabled
-        * Route type is BGP_ROUTE_NORMAL (peer learnt routes)
-        * Route is being installed first time (BGP_NODE_FIB_INSTALLED not set)
-        */
-       if (BGP_SUPPRESS_FIB_ENABLED(bgp) &&
-           (sub_type == BGP_ROUTE_NORMAL) &&
-           (!bgp_option_check(BGP_OPT_NO_FIB)) &&
-           (!CHECK_FLAG(dest->flags, BGP_NODE_FIB_INSTALLED)))
-               SET_FLAG(dest->flags, BGP_NODE_FIB_INSTALL_PENDING);
-
        /* When peer's soft reconfiguration enabled.  Record input packet in
           Adj-RIBs-In.  */
        if (!soft_reconfig
@@ -3791,6 +3778,19 @@ int bgp_update(struct peer *peer, const struct prefix *p, uint32_t addpath_id,
                                     evpn == NULL ? NULL : &evpn->gw_ip);
        }
 
+       /* The flag BGP_NODE_FIB_INSTALL_PENDING is for the following
+        * condition :
+        * Suppress fib is enabled
+        * BGP_OPT_NO_FIB is not enabled
+        * Route type is BGP_ROUTE_NORMAL (peer learnt routes)
+        * Route is being installed first time (BGP_NODE_FIB_INSTALLED not set)
+        */
+       if (bgp_fibupd_safi(safi) && BGP_SUPPRESS_FIB_ENABLED(bgp)
+           && (sub_type == BGP_ROUTE_NORMAL)
+           && (!bgp_option_check(BGP_OPT_NO_FIB))
+           && (!CHECK_FLAG(dest->flags, BGP_NODE_FIB_INSTALLED)))
+               SET_FLAG(dest->flags, BGP_NODE_FIB_INSTALL_PENDING);
+
        attr_new = bgp_attr_intern(&new_attr);
 
        /* If maximum prefix count is configured and current prefix