]> git.puffer.fish Git - matthieu/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)
committerDonald Sharp <sharpd@nvidia.com>
Wed, 30 Sep 2020 21:26:44 +0000 (17:26 -0400)
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 aac0e628fe12fe62b65ce7cdd0962f0ff2d413ff..4e08c327cf3a571f555e306a976f3e8f9381f224 100644 (file)
@@ -921,11 +921,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 {
                /*