diff options
author | Donald Sharp <sharpd@cumulusnetworks.com> | 2017-10-23 16:27:22 +0200 |
---|---|---|
committer | Donald Sharp <sharpd@cumulusnetworks.com> | 2017-10-27 16:41:07 +0200 |
commit | 885141e85e9d0239f6c1aa0eeab8dbc6435e78f7 (patch) | |
tree | c971c30b7d41edcc5f19001c8c39573b7e63cf5d /zebra/zebra_mpls_netlink.c | |
parent | zebra: Move clear_nhlfe_installed to calling functions (diff) | |
download | frr-885141e85e9d0239f6c1aa0eeab8dbc6435e78f7.tar.xz frr-885141e85e9d0239f6c1aa0eeab8dbc6435e78f7.zip |
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>
Diffstat (limited to 'zebra/zebra_mpls_netlink.c')
-rw-r--r-- | zebra/zebra_mpls_netlink.c | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/zebra/zebra_mpls_netlink.c b/zebra/zebra_mpls_netlink.c index 8b8d018d0..887c68549 100644 --- a/zebra/zebra_mpls_netlink.c +++ b/zebra/zebra_mpls_netlink.c @@ -58,17 +58,29 @@ int kernel_add_lsp(zebra_lsp_t *lsp) int kernel_upd_lsp(zebra_lsp_t *lsp) { int ret; + zebra_nhlfe_t *nhlfe; + struct nexthop *nexthop; if (!lsp || !lsp->best_nhlfe) // unexpected return -1; UNSET_FLAG(lsp->flags, LSP_FLAG_CHANGED); - /* First issue a DEL and clear the installed flag. */ - netlink_mpls_multipath(RTM_DELROUTE, lsp); - UNSET_FLAG(lsp->flags, LSP_FLAG_INSTALLED); + /* Any NHLFE that was installed but is not selected now needs to + * have its flags updated. + */ + 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); if (!ret) SET_FLAG(lsp->flags, LSP_FLAG_INSTALLED); |