diff options
| author | Louis Scalbert <louis.scalbert@6wind.com> | 2022-03-21 17:59:27 +0100 | 
|---|---|---|
| committer | Louis Scalbert <louis.scalbert@6wind.com> | 2022-10-24 11:50:13 +0200 | 
| commit | 694fa86728fa1292246ac860c82b051e8d2dbf4a (patch) | |
| tree | b1d385773cf20c0ed29eb6d342563a7aad52fe8a /isisd/isis_circuit.c | |
| parent | 6eb8da37b0e955d4cbe034d4d49743d4d5266101 (diff) | |
isisd: apply fast-reroute on an adjacency failure
When a adjacency falls down, the primary routes are not deleted on the
dataplane until the SPF is recomputed. Even the backup routes are
pre-installed on the dataplane, there is no fast-route optimization.
Reasons for an adjacency to come down are:
- BFD down
- Hello timer timeout
- User adjacency clear
Apply the backup route switchover for fast-reroute as soon an IS-IS
adjacency falls down before the first SPF re-computation. Pre-computed
backup routes are applied sooner.
Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
Diffstat (limited to 'isisd/isis_circuit.c')
| -rw-r--r-- | isisd/isis_circuit.c | 26 | 
1 files changed, 26 insertions, 0 deletions
diff --git a/isisd/isis_circuit.c b/isisd/isis_circuit.c index dcc4ed6e42..7f5426abfa 100644 --- a/isisd/isis_circuit.c +++ b/isisd/isis_circuit.c @@ -598,6 +598,32 @@ size_t isis_circuit_pdu_size(struct isis_circuit *circuit)  	return ISO_MTU(circuit);  } +static bool isis_circuit_lfa_enabled(struct isis_circuit *circuit, int level) +{ +	return (circuit->lfa_protection[level - 1] || +		circuit->rlfa_protection[level - 1] || +		circuit->tilfa_protection[level - 1]); +} + +void isis_circuit_switchover_routes(struct isis_circuit *circuit, int family, +				    union g_addr *nexthop_ip, ifindex_t ifindex) +{ +	char is_type; + +	if (!circuit->area) +		return; + +	is_type = circuit->area->is_type; +	if ((is_type == IS_LEVEL_1 || is_type == IS_LEVEL_1_AND_2) && +	    isis_circuit_lfa_enabled(circuit, IS_LEVEL_1)) +		isis_area_switchover_routes(circuit->area, family, nexthop_ip, +					    ifindex, IS_LEVEL_1); +	if ((is_type == IS_LEVEL_2 || is_type == IS_LEVEL_1_AND_2) && +	    isis_circuit_lfa_enabled(circuit, IS_LEVEL_2)) +		isis_area_switchover_routes(circuit->area, family, nexthop_ip, +					    ifindex, IS_LEVEL_2); +} +  void isis_circuit_stream(struct isis_circuit *circuit, struct stream **stream)  {  	size_t stream_size = isis_circuit_pdu_size(circuit);  | 
