diff options
| author | Louis Scalbert <louis.scalbert@6wind.com> | 2022-03-21 17:59:27 +0100 | 
|---|---|---|
| committer | Louis Scalbert <louis.scalbert@6wind.com> | 2022-05-23 10:44:20 +0200 | 
| commit | 71252973234e70ffa3cb5eec43d4efc1be3d3331 (patch) | |
| tree | c7c00e31f29781ca3ec9f3697550b2c94671c618 /isisd/isis_circuit.c | |
| parent | 44937c5450320eb119f9a4ea0c9bd32600d8e007 (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 | 21 | 
1 files changed, 21 insertions, 0 deletions
diff --git a/isisd/isis_circuit.c b/isisd/isis_circuit.c index fedceed3bb..3bbdaac649 100644 --- a/isisd/isis_circuit.c +++ b/isisd/isis_circuit.c @@ -604,6 +604,27 @@ 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 = 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);  | 
