mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-08-09 11:18:52 +00:00
bfdd: use * as a placeholder for an empty interface name in northbound
Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
This commit is contained in:
parent
2e8d292578
commit
4ec8e74bd9
@ -2178,7 +2178,7 @@ void bfd_session_update_vrf_name(struct bfd_session *bs, struct vrf *vrf)
|
|||||||
"[interface='%s']", bs->key.ifname);
|
"[interface='%s']", bs->key.ifname);
|
||||||
else
|
else
|
||||||
slen += snprintf(xpath + slen, sizeof(xpath) - slen,
|
slen += snprintf(xpath + slen, sizeof(xpath) - slen,
|
||||||
"[interface='']");
|
"[interface='*']");
|
||||||
snprintf(xpath + slen, sizeof(xpath) - slen, "[vrf='%s']/vrf",
|
snprintf(xpath + slen, sizeof(xpath) - slen, "[vrf='%s']/vrf",
|
||||||
bs->key.vrfname);
|
bs->key.vrfname);
|
||||||
|
|
||||||
|
@ -127,7 +127,7 @@ DEFPY_YANG_NOSH(
|
|||||||
"[interface='%s']", ifname);
|
"[interface='%s']", ifname);
|
||||||
else
|
else
|
||||||
slen += snprintf(xpath + slen, sizeof(xpath) - slen,
|
slen += snprintf(xpath + slen, sizeof(xpath) - slen,
|
||||||
"[interface='']");
|
"[interface='*']");
|
||||||
if (vrf)
|
if (vrf)
|
||||||
snprintf(xpath + slen, sizeof(xpath) - slen, "[vrf='%s']", vrf);
|
snprintf(xpath + slen, sizeof(xpath) - slen, "[vrf='%s']", vrf);
|
||||||
else
|
else
|
||||||
@ -185,7 +185,7 @@ DEFPY_YANG(
|
|||||||
"[interface='%s']", ifname);
|
"[interface='%s']", ifname);
|
||||||
else
|
else
|
||||||
slen += snprintf(xpath + slen, sizeof(xpath) - slen,
|
slen += snprintf(xpath + slen, sizeof(xpath) - slen,
|
||||||
"[interface='']");
|
"[interface='*']");
|
||||||
if (vrf)
|
if (vrf)
|
||||||
snprintf(xpath + slen, sizeof(xpath) - slen, "[vrf='%s']", vrf);
|
snprintf(xpath + slen, sizeof(xpath) - slen, "[vrf='%s']", vrf);
|
||||||
else
|
else
|
||||||
@ -218,7 +218,7 @@ static void _bfd_cli_show_peer(struct vty *vty, struct lyd_node *dnode,
|
|||||||
if (strcmp(vrf, VRF_DEFAULT_NAME))
|
if (strcmp(vrf, VRF_DEFAULT_NAME))
|
||||||
vty_out(vty, " vrf %s", vrf);
|
vty_out(vty, " vrf %s", vrf);
|
||||||
|
|
||||||
if (ifname[0])
|
if (strcmp(ifname, "*"))
|
||||||
vty_out(vty, " interface %s", ifname);
|
vty_out(vty, " interface %s", ifname);
|
||||||
|
|
||||||
vty_out(vty, "\n");
|
vty_out(vty, "\n");
|
||||||
|
@ -48,6 +48,9 @@ static void bfd_session_get_key(bool mhop, const struct lyd_node *dnode,
|
|||||||
ifname = yang_dnode_get_string(dnode, "./interface");
|
ifname = yang_dnode_get_string(dnode, "./interface");
|
||||||
vrfname = yang_dnode_get_string(dnode, "./vrf");
|
vrfname = yang_dnode_get_string(dnode, "./vrf");
|
||||||
|
|
||||||
|
if (strcmp(ifname, "*") == 0)
|
||||||
|
ifname = NULL;
|
||||||
|
|
||||||
/* Generate the corresponding key. */
|
/* Generate the corresponding key. */
|
||||||
gen_bfd_key(bk, &psa, &lsa, mhop, ifname, vrfname);
|
gen_bfd_key(bk, &psa, &lsa, mhop, ifname, vrfname);
|
||||||
}
|
}
|
||||||
@ -72,7 +75,7 @@ static int bfd_session_create(enum nb_event event, const struct lyd_node *dnode,
|
|||||||
ifname = yang_dnode_get_string(dnode, "./interface");
|
ifname = yang_dnode_get_string(dnode, "./interface");
|
||||||
|
|
||||||
if (p.family == AF_INET6 && IN6_IS_ADDR_LINKLOCAL(&p.u.prefix6)
|
if (p.family == AF_INET6 && IN6_IS_ADDR_LINKLOCAL(&p.u.prefix6)
|
||||||
&& strlen(ifname) == 0) {
|
&& strcmp(ifname, "*") == 0) {
|
||||||
zlog_warn(
|
zlog_warn(
|
||||||
"%s: when using link-local you must specify an interface.",
|
"%s: when using link-local you must specify an interface.",
|
||||||
__func__);
|
__func__);
|
||||||
|
Loading…
Reference in New Issue
Block a user