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>
This commit is contained in:
Igor Ryzhov 2021-03-03 19:38:38 +03:00
parent f60e5fd3d1
commit 4cce733fc2

View file

@ -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),