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>
This commit is contained in:
Donald Sharp 2020-09-30 17:26:02 -04:00
parent 9805b533eb
commit 5c18e66208

View 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 {
/*