diff options
| author | Donald Sharp <sharpd@cumulusnetworks.com> | 2020-12-09 11:49:22 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-12-09 11:49:22 -0500 |
| commit | 327c3aad2a08021ef2e4239bd0df123fa2845fbd (patch) | |
| tree | 7b36f9accfb5ef9bb3cf4f184e66a3cbd87a5499 /ospfd/ospf_ldp_sync.c | |
| parent | e386d2b15419382d3cf00a6cd986fbdc723b48f5 (diff) | |
| parent | cb135cc94303d2581987645f124bd6d4cecd80a6 (diff) | |
Merge pull request #7686 from volta-networks/fix_ldpsync_igps_detect_client_close
isisd, ospfd: IGPs detect LDP down via zapi client close message
Diffstat (limited to 'ospfd/ospf_ldp_sync.c')
| -rw-r--r-- | ospfd/ospf_ldp_sync.c | 29 |
1 files changed, 28 insertions, 1 deletions
diff --git a/ospfd/ospf_ldp_sync.c b/ospfd/ospf_ldp_sync.c index 68792ebcc2..bca15304b1 100644 --- a/ospfd/ospf_ldp_sync.c +++ b/ospfd/ospf_ldp_sync.c @@ -253,6 +253,33 @@ void ospf_ldp_sync_if_complete(struct interface *ifp) } } +void ospf_ldp_sync_handle_client_close(struct zapi_client_close_info *info) +{ + struct ospf *ospf; + struct vrf *vrf; + struct interface *ifp; + + /* if ospf is not enabled or LDP-SYNC is not configured ignore */ + ospf = ospf_lookup_by_vrf_id(VRF_DEFAULT); + if (ospf == NULL + || !CHECK_FLAG(ospf->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"); + + vrf = vrf_lookup_by_id(ospf->vrf_id); + FOR_ALL_INTERFACES (vrf, ifp) + ospf_ldp_sync_if_start(ifp, true); +} + void ospf_ldp_sync_ldp_fail(struct interface *ifp) { struct ospf_if_params *params; @@ -264,7 +291,7 @@ void ospf_ldp_sync_ldp_fail(struct interface *ifp) params = IF_DEF_PARAMS(ifp); ldp_sync_info = params->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 has learned all labels from peer |
