summaryrefslogtreecommitdiff
path: root/lib/bfd.c
diff options
context:
space:
mode:
authorGalaxyGorilla <sascha@netdef.org>2020-07-10 11:26:55 +0000
committerGalaxyGorilla <sascha@netdef.org>2020-07-10 11:28:43 +0000
commit4affdba79e306d3eab88af0ed63a7ca38ceb77f9 (patch)
tree4fc8adba02c7c0a9fa4eea1c48eecd1fa527e867 /lib/bfd.c
parent4030687aab47da7ea11ff2420fdda016e0e7f9d5 (diff)
*: add BFD profile support for IS-IS
BFD profiles can now be used on the interface level like this: interface eth1 ip router isis 1 isis bfd isis bfd profile default Here the 'default' profile needs to be specified as usual in the bfdd configuration. Signed-off-by: GalaxyGorilla <sascha@netdef.org>
Diffstat (limited to 'lib/bfd.c')
-rw-r--r--lib/bfd.c16
1 files changed, 14 insertions, 2 deletions
diff --git a/lib/bfd.c b/lib/bfd.c
index 7c84648d91..d2bcb5b8aa 100644
--- a/lib/bfd.c
+++ b/lib/bfd.c
@@ -94,7 +94,8 @@ int bfd_validate_param(struct vty *vty, const char *dm_str, const char *rx_str,
* bfd_set_param - Set the configured BFD paramter values
*/
void bfd_set_param(struct bfd_info **bfd_info, uint32_t min_rx, uint32_t min_tx,
- uint8_t detect_mult, int defaults, int *command)
+ uint8_t detect_mult, const char *profile, int defaults,
+ int *command)
{
if (!*bfd_info) {
*bfd_info = bfd_info_create();
@@ -102,7 +103,8 @@ void bfd_set_param(struct bfd_info **bfd_info, uint32_t min_rx, uint32_t min_tx,
} else {
if (((*bfd_info)->required_min_rx != min_rx)
|| ((*bfd_info)->desired_min_tx != min_tx)
- || ((*bfd_info)->detect_mult != detect_mult))
+ || ((*bfd_info)->detect_mult != detect_mult)
+ || (profile && strcmp((*bfd_info)->profile, profile)))
*command = ZEBRA_BFD_DEST_UPDATE;
}
@@ -110,6 +112,11 @@ void bfd_set_param(struct bfd_info **bfd_info, uint32_t min_rx, uint32_t min_tx,
(*bfd_info)->required_min_rx = min_rx;
(*bfd_info)->desired_min_tx = min_tx;
(*bfd_info)->detect_mult = detect_mult;
+ if (profile)
+ strlcpy((*bfd_info)->profile, profile,
+ BFD_PROFILE_NAME_LEN);
+ else
+ (*bfd_info)->profile[0] = '\0';
}
if (!defaults)
@@ -162,6 +169,11 @@ void bfd_peer_sendmsg(struct zclient *zclient, struct bfd_info *bfd_info,
args.min_rx = bfd_info->required_min_rx;
args.min_tx = bfd_info->desired_min_tx;
args.detection_multiplier = bfd_info->detect_mult;
+ if (bfd_info->profile[0]) {
+ args.profilelen = strlen(bfd_info->profile);
+ strlcpy(args.profile, bfd_info->profile,
+ sizeof(args.profile));
+ }
}
addrlen = family == AF_INET ? sizeof(struct in_addr)