]> git.puffer.fish Git - mirror/frr.git/commitdiff
bfdd: use * as a placeholder for an empty interface name in northbound 7063/head
authorIgor Ryzhov <iryzhov@nfware.com>
Thu, 24 Sep 2020 17:43:38 +0000 (20:43 +0300)
committerIgor Ryzhov <iryzhov@nfware.com>
Thu, 24 Sep 2020 17:43:38 +0000 (20:43 +0300)
Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
bfdd/bfd.c
bfdd/bfdd_cli.c
bfdd/bfdd_nb_config.c

index c16912060cfe112694e730cf0ce0895b25fe84fb..b5c029aedf4bb7ed6bd3e5f3141e66c04e4d51e6 100644 (file)
@@ -2178,7 +2178,7 @@ void bfd_session_update_vrf_name(struct bfd_session *bs, struct vrf *vrf)
                                         "[interface='%s']", bs->key.ifname);
                else
                        slen += snprintf(xpath + slen, sizeof(xpath) - slen,
-                                        "[interface='']");
+                                        "[interface='*']");
                snprintf(xpath + slen, sizeof(xpath) - slen, "[vrf='%s']/vrf",
                         bs->key.vrfname);
 
index d115684b1cf4f4c6961424627651f0715049f389..ddec83397dd2d87f4780815769c5cddc1d89dff6 100644 (file)
@@ -127,7 +127,7 @@ DEFPY_YANG_NOSH(
                                 "[interface='%s']", ifname);
        else
                slen += snprintf(xpath + slen, sizeof(xpath) - slen,
-                                "[interface='']");
+                                "[interface='*']");
        if (vrf)
                snprintf(xpath + slen, sizeof(xpath) - slen, "[vrf='%s']", vrf);
        else
@@ -185,7 +185,7 @@ DEFPY_YANG(
                                 "[interface='%s']", ifname);
        else
                slen += snprintf(xpath + slen, sizeof(xpath) - slen,
-                                "[interface='']");
+                                "[interface='*']");
        if (vrf)
                snprintf(xpath + slen, sizeof(xpath) - slen, "[vrf='%s']", vrf);
        else
@@ -218,7 +218,7 @@ static void _bfd_cli_show_peer(struct vty *vty, struct lyd_node *dnode,
        if (strcmp(vrf, VRF_DEFAULT_NAME))
                vty_out(vty, " vrf %s", vrf);
 
-       if (ifname[0])
+       if (strcmp(ifname, "*"))
                vty_out(vty, " interface %s", ifname);
 
        vty_out(vty, "\n");
index b34e06d2305ec9039b5e66507e4c5cefda57e4d4..fe6a0b7905694e09a0282ca7ecd8a6c1f3475aa1 100644 (file)
@@ -48,6 +48,9 @@ static void bfd_session_get_key(bool mhop, const struct lyd_node *dnode,
        ifname = yang_dnode_get_string(dnode, "./interface");
        vrfname = yang_dnode_get_string(dnode, "./vrf");
 
+       if (strcmp(ifname, "*") == 0)
+               ifname = NULL;
+
        /* Generate the corresponding key. */
        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");
 
                if (p.family == AF_INET6 && IN6_IS_ADDR_LINKLOCAL(&p.u.prefix6)
-                   && strlen(ifname) == 0) {
+                   && strcmp(ifname, "*") == 0) {
                        zlog_warn(
                                "%s: when using link-local you must specify an interface.",
                                __func__);