summaryrefslogtreecommitdiff
path: root/lib/bfd.c
diff options
context:
space:
mode:
authorRuss White <russ@riw.us>2025-02-04 06:36:43 -0500
committerGitHub <noreply@github.com>2025-02-04 06:36:43 -0500
commitadeb30d8f37ef3668bbc56a1e1347ac451bba479 (patch)
tree88251415f13e7c243b3f7f2c91269ad94dce6bd4 /lib/bfd.c
parent817c2c98230f3825df65283fc68f1b8f8a317d04 (diff)
parent427cf6627db14475fb505d6ac85f35c140aaeaa5 (diff)
Merge pull request #17336 from forrestchu/sbfd
implement SBFD
Diffstat (limited to 'lib/bfd.c')
-rw-r--r--lib/bfd.c19
1 files changed, 14 insertions, 5 deletions
diff --git a/lib/bfd.c b/lib/bfd.c
index bc4b1c5b51..6300f6f5c0 100644
--- a/lib/bfd.c
+++ b/lib/bfd.c
@@ -18,6 +18,7 @@
#include "table.h"
#include "vty.h"
#include "bfd.h"
+#include "bfdd/bfd.h"
DEFINE_MTYPE_STATIC(LIB, BFD_INFO, "BFD info");
DEFINE_MTYPE_STATIC(LIB, BFD_SOURCE, "BFD source cache");
@@ -140,14 +141,15 @@ static void bfd_source_cache_put(struct bfd_session_params *session);
* bfd_get_peer_info - Extract the Peer information for which the BFD session
* went down from the message sent from Zebra to clients.
*/
-static struct interface *bfd_get_peer_info(struct stream *s, struct prefix *dp,
- struct prefix *sp, int *status,
- int *remote_cbit, vrf_id_t vrf_id)
+static struct interface *bfd_get_peer_info(struct stream *s, struct prefix *dp, struct prefix *sp,
+ int *status, int *remote_cbit, vrf_id_t vrf_id,
+ char *bfd_name)
{
unsigned int ifindex;
struct interface *ifp = NULL;
int plen;
int local_remote_cbit;
+ uint8_t bfd_name_len = 0;
/*
* If the ifindex lookup fails the
@@ -194,6 +196,13 @@ static struct interface *bfd_get_peer_info(struct stream *s, struct prefix *dp,
STREAM_GETC(s, local_remote_cbit);
if (remote_cbit)
*remote_cbit = local_remote_cbit;
+
+ STREAM_GETC(s, bfd_name_len);
+ if (bfd_name_len) {
+ STREAM_GET(bfd_name, s, bfd_name_len);
+ *(bfd_name + bfd_name_len) = 0;
+ }
+
return ifp;
stream_failure:
@@ -918,6 +927,7 @@ int zclient_bfd_session_update(ZAPI_CALLBACK_ARGS)
struct prefix dp;
struct prefix sp;
char ifstr[128], cbitstr[32];
+ char bfd_name[BFD_NAME_SIZE + 1] = { 0 };
if (!zclient->bfd_integration)
return 0;
@@ -926,8 +936,7 @@ int zclient_bfd_session_update(ZAPI_CALLBACK_ARGS)
if (bsglobal.shutting_down)
return 0;
- ifp = bfd_get_peer_info(zclient->ibuf, &dp, &sp, &state, &remote_cbit,
- vrf_id);
+ ifp = bfd_get_peer_info(zclient->ibuf, &dp, &sp, &state, &remote_cbit, vrf_id, bfd_name);
/*
* When interface lookup fails or an invalid stream is read, we must
* not proceed otherwise it will trigger an assertion while checking