summaryrefslogtreecommitdiffstats
path: root/ospfd/ospf_ldp_sync.c
diff options
context:
space:
mode:
authorKaren Schoener <karen@voltanet.io>2020-12-08 15:44:27 +0100
committerKaren Schoener <karen@volta.io>2020-12-09 14:41:42 +0100
commitcb135cc94303d2581987645f124bd6d4cecd80a6 (patch)
tree5dd374ddd2105b3a82439ec1c4e8ea686b5e55d0 /ospfd/ospf_ldp_sync.c
parentMerge pull request #7683 from volta-networks/feat_zapi_client_close (diff)
downloadfrr-cb135cc94303d2581987645f124bd6d4cecd80a6.tar.xz
frr-cb135cc94303d2581987645f124bd6d4cecd80a6.zip
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 'ospfd/ospf_ldp_sync.c')
-rw-r--r--ospfd/ospf_ldp_sync.c29
1 files changed, 28 insertions, 1 deletions
diff --git a/ospfd/ospf_ldp_sync.c b/ospfd/ospf_ldp_sync.c
index 68792ebcc..bca15304b 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