summaryrefslogtreecommitdiff
path: root/bfdd/bfdd_cli.c
diff options
context:
space:
mode:
authorIgor Ryzhov <iryzhov@nfware.com>2021-03-03 19:38:38 +0300
committerIgor Ryzhov <iryzhov@nfware.com>2021-03-03 19:38:38 +0300
commit4cce733fc200ebb69fccacc35fde9aa9b7264ad3 (patch)
tree1177c6be9594a650b627fcc74b1458c3805dc766 /bfdd/bfdd_cli.c
parentf60e5fd3d1d5ff88968713061edba96024a5e235 (diff)
bfdd: require local-address when using multihop
If local-address is not supplied, then an incorrect xpath is generated which is not expected by NB CLI. Fixes #7465. Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
Diffstat (limited to 'bfdd/bfdd_cli.c')
-rw-r--r--bfdd/bfdd_cli.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/bfdd/bfdd_cli.c b/bfdd/bfdd_cli.c
index b9e7903613..84354e243d 100644
--- a/bfdd/bfdd_cli.c
+++ b/bfdd/bfdd_cli.c
@@ -117,10 +117,14 @@ DEFPY_YANG_NOSH(
char source_str[INET6_ADDRSTRLEN + 32];
char xpath[XPATH_MAXLEN], xpath_srcaddr[XPATH_MAXLEN + 32];
- if (multihop)
+ if (multihop) {
+ if (!local_address_str) {
+ vty_out(vty, "%% local-address is required when using multihop\n");
+ return CMD_WARNING_CONFIG_FAILED;
+ }
snprintf(source_str, sizeof(source_str), "[source-addr='%s']",
local_address_str);
- else
+ } else
source_str[0] = 0;
slen = snprintf(xpath, sizeof(xpath),