diff options
Diffstat (limited to 'isisd/isis_ldp_sync.c')
| -rw-r--r-- | isisd/isis_ldp_sync.c | 40 |
1 files changed, 39 insertions, 1 deletions
diff --git a/isisd/isis_ldp_sync.c b/isisd/isis_ldp_sync.c index 3b1faffe53..c9d29871ae 100644 --- a/isisd/isis_ldp_sync.c +++ b/isisd/isis_ldp_sync.c @@ -293,7 +293,7 @@ void isis_ldp_sync_ldp_fail(struct isis_circuit *circuit) ldp_sync_info = circuit->ldp_sync_info; - /* LDP failed to send hello: + /* LDP client close detected: * stop holddown timer * set cost of interface to LSInfinity so traffic will use different * interface until LDP restarts and has learned all labels from peer @@ -522,6 +522,44 @@ void isis_ldp_sync_holddown_timer_add(struct isis_circuit *circuit) } /* + * LDP-SYNC handle client close routine + */ +void isis_ldp_sync_handle_client_close(struct zapi_client_close_info *info) +{ + struct isis_area *area; + struct listnode *node; + struct isis_circuit *circuit; + struct interface *ifp; + struct vrf *vrf = vrf_lookup_by_id(VRF_DEFAULT); + struct isis *isis = isis_lookup_by_vrfid(VRF_DEFAULT); + + /* if isis is not enabled or LDP-SYNC is not configured ignore */ + if (!isis + || !CHECK_FLAG(isis->ldp_sync_cmd.flags, LDP_SYNC_FLAG_ENABLE)) + return; + + /* Check if the LDP main client session closed */ + if (info->proto != ZEBRA_ROUTE_LDP || info->session_id == 0) + return; + + /* Handle the zebra notification that the LDP client session closed. + * set cost to LSInfinity + * send request to LDP for LDP-SYNC state for each interface + */ + zlog_err("ldp_sync: LDP down"); + + FOR_ALL_INTERFACES (vrf, ifp) { + for (ALL_LIST_ELEMENTS_RO(isis->area_list, node, area)) { + circuit = + circuit_lookup_by_ifp(ifp, area->circuit_list); + if (circuit == NULL) + continue; + isis_ldp_sync_if_start(circuit, true); + } + } +} + +/* * LDP-SYNC hello timer routines */ static int isis_ldp_sync_hello_timer(struct thread *thread) |
