summaryrefslogtreecommitdiff
path: root/lib/bfd.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/bfd.c')
-rw-r--r--lib/bfd.c20
1 files changed, 14 insertions, 6 deletions
diff --git a/lib/bfd.c b/lib/bfd.c
index 1a45ea1ff5..70cbe0f2a6 100644
--- a/lib/bfd.c
+++ b/lib/bfd.c
@@ -203,7 +203,7 @@ static void bfd_last_update(time_t last_update, char *buf, size_t len)
struct tm tm;
struct timeval tv;
- /* If no BFD satatus update has ever been received, print `never'. */
+ /* If no BFD status update has ever been received, print `never'. */
if (last_update == 0) {
snprintf(buf, len, "never");
return;
@@ -366,6 +366,9 @@ int zclient_bfd_command(struct zclient *zc, struct bfd_session_arg *args)
if (args->ifnamelen)
stream_put(s, args->ifname, args->ifnamelen);
}
+
+ /* Send the C bit indicator. */
+ stream_putc(s, args->cbit);
#endif /* HAVE_BFDD */
/* Finish the message by writing the size. */
@@ -818,10 +821,13 @@ void bfd_sess_show(struct vty *vty, struct json_object *json,
*
* Use this as `zclient` `bfd_dest_replay` callback.
*/
-static int zclient_bfd_session_reply(ZAPI_CALLBACK_ARGS)
+int zclient_bfd_session_reply(ZAPI_CALLBACK_ARGS)
{
struct bfd_session_params *bsp;
+ if (!zclient->bfd_integration)
+ return 0;
+
/* Do nothing when shutting down. */
if (bsglobal.shutting_down)
return 0;
@@ -852,7 +858,7 @@ static int zclient_bfd_session_reply(ZAPI_CALLBACK_ARGS)
return 0;
}
-static int zclient_bfd_session_update(ZAPI_CALLBACK_ARGS)
+int zclient_bfd_session_update(ZAPI_CALLBACK_ARGS)
{
struct bfd_session_params *bsp, *bspn;
size_t sessions_updated = 0;
@@ -865,6 +871,9 @@ static int zclient_bfd_session_update(ZAPI_CALLBACK_ARGS)
struct prefix sp;
char ifstr[128], cbitstr[32];
+ if (!zclient->bfd_integration)
+ return 0;
+
/* Do nothing when shutting down. */
if (bsglobal.shutting_down)
return 0;
@@ -966,9 +975,8 @@ void bfd_protocol_integration_init(struct zclient *zc, struct thread_master *tm)
bsglobal.zc = zc;
bsglobal.tm = tm;
- /* Install our callbacks. */
- zc->interface_bfd_dest_update = zclient_bfd_session_update;
- zc->bfd_dest_replay = zclient_bfd_session_reply;
+ /* Enable BFD callbacks. */
+ zc->bfd_integration = true;
/* Send the client registration */
bfd_client_sendmsg(zc, ZEBRA_BFD_CLIENT_REGISTER, VRF_DEFAULT);