summaryrefslogtreecommitdiffstats
path: root/isisd/isis_adjacency.c
diff options
context:
space:
mode:
authorLouis Scalbert <louis.scalbert@6wind.com>2022-03-21 17:59:27 +0100
committerLouis Scalbert <louis.scalbert@6wind.com>2022-10-24 11:50:13 +0200
commit694fa86728fa1292246ac860c82b051e8d2dbf4a (patch)
treeb1d385773cf20c0ed29eb6d342563a7aad52fe8a /isisd/isis_adjacency.c
parentMerge pull request #12026 from kuldeepkash/bgp_local_asn (diff)
downloadfrr-694fa86728fa1292246ac860c82b051e8d2dbf4a.tar.xz
frr-694fa86728fa1292246ac860c82b051e8d2dbf4a.zip
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.c39
1 files changed, 39 insertions, 0 deletions
diff --git a/isisd/isis_adjacency.c b/isisd/isis_adjacency.c
index 00763135e..cac460af3 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,15 @@ 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);