diff options
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); |
