From 6dfb7f5961d8a502b92718172c2e87dcf5db4046 Mon Sep 17 00:00:00 2001 From: Renato Westphal Date: Thu, 5 Nov 2020 10:52:14 -0300 Subject: [PATCH] isisd: consult locally configured MSD when computing TI-LFA repair paths Do not attempt to install a TI-LFA backup nexthop if its number of labels exceeds the locally configured MSD (Maximum Stack Depth). The idea is to prevent forward-plane installation failures before they happen. The MSD check should also allow the "show isis fast-reroute summary" command (not implemented yet) to display the actual protection coverage provided by TI-LFA, which might not be 100% if the MSD isn't big enough. Signed-off-by: Renato Westphal --- isisd/isis_lfa.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/isisd/isis_lfa.c b/isisd/isis_lfa.c index f22e4a7085..66572d0a0b 100644 --- a/isisd/isis_lfa.c +++ b/isisd/isis_lfa.c @@ -533,6 +533,14 @@ static int tilfa_build_repair_list(struct isis_spftree *spftree_pc, listnode_add_head(repair_list, &sid_pnode); /* Apply repair list. */ + if (listcount(repair_list) + > spftree_pc->area->srdb.config.msd) { + zlog_warn( + "ISIS-TI-LFA: list of repair segments exceeds locally configured MSD (%u > %u)", + listcount(repair_list), + spftree_pc->area->srdb.config.msd); + return -1; + } if (tilfa_repair_list_apply(spftree_pc, vertex_dest, vertex, repair_list) != 0) @@ -735,7 +743,11 @@ int isis_lfa_check(struct isis_spftree *spftree_pc, struct isis_vertex *vertex) isis_spf_node_list_clear(&used_pnodes); list_delete(&repair_list); if (ret != 0) - zlog_warn("ISIS-TI-LFA: failed to compute repair path(s)"); + zlog_warn( + "ISIS-TI-LFA: failed to compute repair path(s) of %s %s w.r.t %s", + vtype2string(vertex->type), buf, + lfa_protected_resource2str( + &spftree_pc->lfa.protected_resource)); return ret; } -- 2.39.5