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_adjacency.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_adjacency.c')
| -rw-r--r-- | isisd/isis_adjacency.c | 40 | 
1 files changed, 40 insertions, 0 deletions
diff --git a/isisd/isis_adjacency.c b/isisd/isis_adjacency.c index 11f17ec7bf..5b32a9e388 100644 --- a/isisd/isis_adjacency.c +++ b/isisd/isis_adjacency.c @@ -212,6 +212,36 @@ static const char *adj_level2string(int level)  	return NULL; /* not reached */  } +static void isis_adj_route_switchover(struct isis_adjacency *adj) +{ +	union g_addr ip = {}; +	ifindex_t ifindex; +	unsigned int i; + +	if (!adj->circuit || !adj->circuit->interface) +		return; + +	ifindex = adj->circuit->interface->ifindex; + +	for (i = 0; i < adj->ipv4_address_count; i++) { +		ip.ipv4 = adj->ipv4_addresses[i]; +		isis_circuit_switchover_routes(adj->circuit, AF_INET, &ip, +					       ifindex); +	} + +	for (i = 0; i < adj->ll_ipv6_count; i++) { +		ip.ipv6 = adj->ll_ipv6_addrs[i]; +		isis_circuit_switchover_routes(adj->circuit, AF_INET6, &ip, +					       ifindex); +	} + +	for (i = 0; i < adj->global_ipv6_count; i++) { +		ip.ipv6 = adj->global_ipv6_addrs[i]; +		isis_circuit_switchover_routes(adj->circuit, AF_INET6, &ip, +					       ifindex); +	} +} +  void isis_adj_process_threeway(struct isis_adjacency *adj,  			       struct isis_threeway_adj *tw_adj,  			       enum isis_adj_usage adj_usage) @@ -298,6 +328,16 @@ void isis_adj_state_change(struct isis_adjacency **padj,  	if (new_state == old_state)  		return; +	if (old_state == ISIS_ADJ_UP) { +		if (IS_DEBUG_EVENTS) +			zlog_debug( +				"ISIS-Adj (%s): Starting fast-reroute on state change " +				"%d->%d: %s", +				circuit->area->area_tag, old_state, new_state, +				reason ? reason : "unspecified"); +		isis_adj_route_switchover(adj); +	} +  	adj->adj_state = new_state;  	send_hello_sched(circuit, adj->level, TRIGGERED_IIH_DELAY);  | 
