diff options
| author | Karen Schoener <karen@voltanet.io> | 2020-12-08 09:44:27 -0500 | 
|---|---|---|
| committer | Karen Schoener <karen@volta.io> | 2020-12-09 08:41:42 -0500 | 
| commit | cb135cc94303d2581987645f124bd6d4cecd80a6 (patch) | |
| tree | 5dd374ddd2105b3a82439ec1c4e8ea686b5e55d0 /isisd/isis_ldp_sync.c | |
| parent | b64e1733746a2cabb5b25b283407c095fc1c8c3a (diff) | |
isisd, ospfd: IGPs detect LDP down via zapi client close message
When ldp-sync is configured, IGPs take action if the LDP process goes down.
Currently, IGPs detect the LDP process is down if they do not receive a
periodic 'hello' message from LDP within 1 second.
Intermittently, this heartbeat mechanism causes false topotest failures.
When the failure occurs, LDP is busy receiving messages from zebra for a
few seconds.  During this time, LDP does not send the expected periodic
message.
With this change, IGPs detect LDP down via zapi client close message.
Signed-off-by: Karen Schoener <karen@voltanet.io>
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)  | 
