summaryrefslogtreecommitdiffstats
path: root/zebra/zebra_mpls_netlink.c
diff options
context:
space:
mode:
authorDonald Sharp <sharpd@cumulusnetworks.com>2017-10-23 16:27:22 +0200
committerDonald Sharp <sharpd@cumulusnetworks.com>2017-10-27 16:41:07 +0200
commit885141e85e9d0239f6c1aa0eeab8dbc6435e78f7 (patch)
treec971c30b7d41edcc5f19001c8c39573b7e63cf5d /zebra/zebra_mpls_netlink.c
parentzebra: Move clear_nhlfe_installed to calling functions (diff)
downloadfrr-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.c20
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);