summaryrefslogtreecommitdiffstats
path: root/bfdd/bfdd_cli.c
diff options
context:
space:
mode:
authorIgor Ryzhov <iryzhov@nfware.com>2021-03-04 19:17:20 +0100
committerIgor Ryzhov <iryzhov@nfware.com>2021-03-04 19:17:20 +0100
commit17cb53af259d9916899820196c8da68f40746657 (patch)
tree09f1d3fa6412488149304717fb8a50447e0225c8 /bfdd/bfdd_cli.c
parentbfdd: forbid creation of the same peer with and without interface name (diff)
downloadfrr-17cb53af259d9916899820196c8da68f40746657.tar.xz
frr-17cb53af259d9916899820196c8da68f40746657.zip
bfdd: fix echo configuration in profile
It's not currently possible to configure echo mode in profile node: ``` (config)# bfd (config-bfd)# profile test (config-bfd-profile)# echo-mode % Echo mode is only available for single hop sessions. (config-bfd-profile)# echo-interval 20 % Echo mode is only available for single hop sessions. ``` Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
Diffstat (limited to 'bfdd/bfdd_cli.c')
-rw-r--r--bfdd/bfdd_cli.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/bfdd/bfdd_cli.c b/bfdd/bfdd_cli.c
index 84354e243..5072c76aa 100644
--- a/bfdd/bfdd_cli.c
+++ b/bfdd/bfdd_cli.c
@@ -57,6 +57,12 @@ bfd_cli_is_single_hop(struct vty *vty)
return strstr(VTY_CURR_XPATH, "/single-hop") != NULL;
}
+static bool
+bfd_cli_is_profile(struct vty *vty)
+{
+ return strstr(VTY_CURR_XPATH, "/bfd/profile") != NULL;
+}
+
/*
* Functions.
*/
@@ -422,7 +428,7 @@ DEFPY_YANG(
NO_STR
"Configure echo mode\n")
{
- if (!bfd_cli_is_single_hop(vty)) {
+ if (!bfd_cli_is_profile(vty) && !bfd_cli_is_single_hop(vty)) {
vty_out(vty, "%% Echo mode is only available for single hop sessions.\n");
return CMD_WARNING_CONFIG_FAILED;
}
@@ -450,7 +456,7 @@ DEFPY_YANG(
{
char value[32];
- if (!bfd_cli_is_single_hop(vty)) {
+ if (!bfd_cli_is_profile(vty) && !bfd_cli_is_single_hop(vty)) {
vty_out(vty, "%% Echo mode is only available for single hop sessions.\n");
return CMD_WARNING_CONFIG_FAILED;
}