From bb49a12161b8ab63bdf2f2f3f1566aa1bb32d124 Mon Sep 17 00:00:00 2001 From: Fredi Raspall Date: Wed, 30 Nov 2016 19:15:07 +0100 Subject: [PATCH] zebra_mpls. Set best lsp nhlfe to null on deletion When a nhlfe was deleted and it happened to be the best, lsp->best_nhlfe was not updated causing lsp_process() to see an inexistent nhlfe. Fix: set lsp->best_nhlfe to null on deletion. --- zebra/zebra_mpls.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/zebra/zebra_mpls.c b/zebra/zebra_mpls.c index b057a78788..decf3f5f8d 100644 --- a/zebra/zebra_mpls.c +++ b/zebra/zebra_mpls.c @@ -751,6 +751,9 @@ nhlfe_del (zebra_nhlfe_t *nhlfe) else lsp->nhlfe_list = nhlfe->next; + if (nhlfe == lsp->best_nhlfe) + lsp->best_nhlfe = NULL; + XFREE (MTYPE_NHLFE, nhlfe); return 0; -- 2.39.5