mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-06-15 13:30:21 +00:00
zebra: Add back in lsp replace semantics.
When we have a update, we need to use replace semantics with the kernel. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
This commit is contained in:
parent
3d468f6604
commit
885141e85e
@ -58,17 +58,29 @@ int kernel_add_lsp(zebra_lsp_t *lsp)
|
|||||||
int kernel_upd_lsp(zebra_lsp_t *lsp)
|
int kernel_upd_lsp(zebra_lsp_t *lsp)
|
||||||
{
|
{
|
||||||
int ret;
|
int ret;
|
||||||
|
zebra_nhlfe_t *nhlfe;
|
||||||
|
struct nexthop *nexthop;
|
||||||
|
|
||||||
if (!lsp || !lsp->best_nhlfe) // unexpected
|
if (!lsp || !lsp->best_nhlfe) // unexpected
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
UNSET_FLAG(lsp->flags, LSP_FLAG_CHANGED);
|
UNSET_FLAG(lsp->flags, LSP_FLAG_CHANGED);
|
||||||
|
|
||||||
/* First issue a DEL and clear the installed flag. */
|
/* Any NHLFE that was installed but is not selected now needs to
|
||||||
netlink_mpls_multipath(RTM_DELROUTE, lsp);
|
* have its flags updated.
|
||||||
UNSET_FLAG(lsp->flags, LSP_FLAG_INSTALLED);
|
*/
|
||||||
|
for (nhlfe = lsp->nhlfe_list; nhlfe; nhlfe = nhlfe->next) {
|
||||||
|
nexthop = nhlfe->nexthop;
|
||||||
|
if (!nexthop)
|
||||||
|
continue;
|
||||||
|
|
||||||
|
if (CHECK_FLAG(nhlfe->flags, NHLFE_FLAG_INSTALLED) &&
|
||||||
|
!CHECK_FLAG(nhlfe->flags, NHLFE_FLAG_SELECTED)) {
|
||||||
|
UNSET_FLAG(nhlfe->flags, NHLFE_FLAG_INSTALLED);
|
||||||
|
UNSET_FLAG(nexthop->flags, NEXTHOP_FLAG_FIB);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/* Then issue an ADD. */
|
|
||||||
ret = netlink_mpls_multipath(RTM_NEWROUTE, lsp);
|
ret = netlink_mpls_multipath(RTM_NEWROUTE, lsp);
|
||||||
if (!ret)
|
if (!ret)
|
||||||
SET_FLAG(lsp->flags, LSP_FLAG_INSTALLED);
|
SET_FLAG(lsp->flags, LSP_FLAG_INSTALLED);
|
||||||
|
Loading…
Reference in New Issue
Block a user