diff options
| author | Renato Westphal <renato@opensourcerouting.org> | 2021-02-26 13:39:02 -0300 | 
|---|---|---|
| committer | Renato Westphal <renato@opensourcerouting.org> | 2021-02-26 15:54:01 -0300 | 
| commit | 784f92f0522c121a0576a83067c31004b68ef0bf (patch) | |
| tree | 238ef5b120c8238ada768fa793d2504ac0dfc447 /isisd/isis_lfa.c | |
| parent | 5dd20c560e76fe02759c275139d64850721197dc (diff) | |
isisd: handle corner case involving TI-LFA and the SR No-PHP flag
When the last SID in the TI-LFA repair list is an Adj-SID from the
penultimate hop router towards the final hop, the No-PHP flag of the
original Prefix-SID must be honored in the repair list itself since
the penultimate hop router won't have a chance to process that SID
and pop it if necessary.
Reported-by: Fredi Raspall <fredi@voltanet.io>
Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
Diffstat (limited to 'isisd/isis_lfa.c')
| -rw-r--r-- | isisd/isis_lfa.c | 15 | 
1 files changed, 15 insertions, 0 deletions
diff --git a/isisd/isis_lfa.c b/isisd/isis_lfa.c index 2d1652b207..3ebac8aaa9 100644 --- a/isisd/isis_lfa.c +++ b/isisd/isis_lfa.c @@ -669,6 +669,21 @@ static int tilfa_build_repair_list(struct isis_spftree *spftree_pc,  	if ((!is_qnode  	     || spftree_pc->lfa.protected_resource.type == LFA_NODE_PROTECTION)  	    && vertex_child) { +		/* +		 * If vertex is the penultimate hop router, then pushing an +		 * Adj-SID towards the final hop means that the No-PHP flag of +		 * the original Prefix-SID must be honored. We do that by +		 * removing the previously added Prefix-SID from the repair list +		 * when those conditions are met. +		 */ +		if (vertex->depth == (vertex_dest->depth - 2) +		    && VTYPE_IP(vertex_dest->type) +		    && vertex_dest->N.ip.sr.present +		    && !CHECK_FLAG(vertex_dest->N.ip.sr.sid.flags, +				   ISIS_PREFIX_SID_NO_PHP)) { +			list_delete_all_node(repair_list); +		} +  		label_qnode = tilfa_find_qnode_adj_sid(spftree_pc, vertex->N.id,  						       vertex_child->N.id);  		if (label_qnode == MPLS_INVALID_LABEL) {  | 
