]> git.puffer.fish Git - mirror/frr.git/commitdiff
zebra: reset LSP backup nh info on update 6857/head
authorMark Stapp <mjs@voltanet.io>
Tue, 4 Aug 2020 16:46:26 +0000 (12:46 -0400)
committerMark Stapp <mjs@voltanet.io>
Tue, 4 Aug 2020 16:49:24 +0000 (12:49 -0400)
If an existing LSP nh is updated, ensure any backup nh
info is also reset.

Signed-off-by: Mark Stapp <mjs@voltanet.io>
zebra/zebra_mpls.c

index f90503632363ba7034940630fcd3c4de608646fd..1ac7bc7a2a40d299d5a6dd9558b8ea25ffa740c1 100644 (file)
@@ -3321,7 +3321,7 @@ lsp_add_nhlfe(zebra_lsp_t *lsp, enum lsp_types_t type,
 
 /*
  * Install an LSP and forwarding entry; used primarily
- * from zapi message processing.
+ * from vrf zapi message processing.
  */
 int mpls_lsp_install(struct zebra_vrf *zvrf, enum lsp_types_t type,
                     mpls_label_t in_label, uint8_t num_out_labels,
@@ -3381,6 +3381,10 @@ static int lsp_znh_install(zebra_lsp_t *lsp, enum lsp_types_t type,
                memcpy(nhlfe->nexthop->backup_idx, znh->backup_idx,
                       znh->backup_num);
                SET_FLAG(nhlfe->nexthop->flags, NEXTHOP_FLAG_HAS_BACKUP);
+       } else {
+               /* Ensure there's no stale backup info */
+               UNSET_FLAG(nhlfe->nexthop->flags, NEXTHOP_FLAG_HAS_BACKUP);
+               nhlfe->nexthop->backup_num = 0;
        }
 
        /* Queue LSP for processing. */