]> git.puffer.fish Git - mirror/frr.git/commitdiff
zebra_mpls. Set best lsp nhlfe to null on deletion
authorFredi Raspall <fredi@voltanet.io>
Wed, 30 Nov 2016 18:15:07 +0000 (19:15 +0100)
committerRenato Westphal <renato@opensourcerouting.org>
Wed, 14 Dec 2016 20:28:26 +0000 (18:28 -0200)
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

index b057a78788294b29b0cf51ba49f9151915dd6a57..decf3f5f8df41aee3bea4fdc2abf4326d470a845 100644 (file)
@@ -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;