]> git.puffer.fish Git - mirror/frr.git/commitdiff
zebra: Prevent uninstall attempts when new entry is not happy
authorDonald Sharp <sharpd@nvidia.com>
Wed, 30 Sep 2020 21:26:02 +0000 (17:26 -0400)
committerIgor Ryzhov <iryzhov@nfware.com>
Wed, 7 Oct 2020 08:01:16 +0000 (11:01 +0300)
In rib_process_update_fib, the function is sent two route entries
the old ( previously installed ) and new ( the one to install )
When the function detects that the new is unusable because
the number of nexthops that are usable for that route is 0,
then we uninstall the old route.  The problem here is that
we should not attempt to uninstall any route that is
not owned by FRR.  Modify the code to not attempt
this behavior

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
zebra/zebra_rib.c

index ff30de18a3ff895acd2870262d677696f04e1c36..4fa62151fc2a280f73d592d0b9def351ab1d0c75 100644 (file)
@@ -898,11 +898,22 @@ static void rib_process_update_fib(struct zebra_vrf *zvrf,
                                                zebra_route_string(new->type));
                        }
 
-                       /* If labeled-unicast route, uninstall transit LSP. */
-                       if (zebra_rib_labeled_unicast(old))
-                               zebra_mpls_lsp_uninstall(zvrf, rn, old);
+                       /*
+                        * When we have gotten to this point
+                        * the new route entry has no nexthops
+                        * that are usable and as such we need
+                        * to remove the old route, but only
+                        * if we were the one who installed
+                        * the old route
+                        */
+                       if (!RIB_SYSTEM_ROUTE(old)) {
+                               /* If labeled-unicast route, uninstall transit
+                                * LSP. */
+                               if (zebra_rib_labeled_unicast(old))
+                                       zebra_mpls_lsp_uninstall(zvrf, rn, old);
 
-                       rib_uninstall_kernel(rn, old);
+                               rib_uninstall_kernel(rn, old);
+                       }
                }
        } else {
                /*