summaryrefslogtreecommitdiff
path: root/zebra/zebra_mpls.c
diff options
context:
space:
mode:
Diffstat (limited to 'zebra/zebra_mpls.c')
-rw-r--r--zebra/zebra_mpls.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/zebra/zebra_mpls.c b/zebra/zebra_mpls.c
index 57d29050c9..4c6fb002dc 100644
--- a/zebra/zebra_mpls.c
+++ b/zebra/zebra_mpls.c
@@ -909,10 +909,33 @@ static wq_item_status lsp_process(struct work_queue *wq, void *data)
zvrf->lsp_removals++;
} else if (CHECK_FLAG(lsp->flags, LSP_FLAG_CHANGED)) {
+ zebra_nhlfe_t *nhlfe;
+ struct nexthop *nexthop;
UNSET_FLAG(lsp->flags, LSP_FLAG_CHANGED);
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);
+ }
+ }
+
kernel_upd_lsp(lsp);
zvrf->lsp_installs++;