diff options
author | Donald Sharp <sharpd@nvidia.com> | 2020-09-30 23:26:02 +0200 |
---|---|---|
committer | Donald Sharp <sharpd@nvidia.com> | 2020-09-30 23:26:44 +0200 |
commit | 5c18e66208b9c99a8c8bc4af93528404b341862b (patch) | |
tree | e323578f36778a9c9bf971ec03a798555896e0f0 /zebra/zebra_rib.c | |
parent | Merge pull request #7195 from tashanamatl/lookup_fix (diff) | |
download | frr-5c18e66208b9c99a8c8bc4af93528404b341862b.tar.xz frr-5c18e66208b9c99a8c8bc4af93528404b341862b.zip |
zebra: Prevent uninstall attempts when new entry is not happy
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>
Diffstat (limited to 'zebra/zebra_rib.c')
-rw-r--r-- | zebra/zebra_rib.c | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/zebra/zebra_rib.c b/zebra/zebra_rib.c index aac0e628f..4e08c327c 100644 --- a/zebra/zebra_rib.c +++ b/zebra/zebra_rib.c @@ -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 { /* |