]> git.puffer.fish Git - mirror/frr.git/commitdiff
bfdd: interface and vrf are mandatory leafs
authorIgor Ryzhov <iryzhov@nfware.com>
Thu, 24 Sep 2020 17:23:21 +0000 (20:23 +0300)
committerIgor Ryzhov <iryzhov@nfware.com>
Thu, 24 Sep 2020 17:23:21 +0000 (20:23 +0300)
Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
bfdd/bfdd_nb_config.c

index 0046bc625b4503f674695d8627f751d0f3a11fe0..b34e06d2305ec9039b5e66507e4c5cefda57e4d4 100644 (file)
@@ -45,11 +45,8 @@ static void bfd_session_get_key(bool mhop, const struct lyd_node *dnode,
        if (yang_dnode_exists(dnode, "./source-addr"))
                strtosa(yang_dnode_get_string(dnode, "./source-addr"), &lsa);
 
-       /* Get optional interface and vrf names. */
-       if (yang_dnode_exists(dnode, "./interface"))
-               ifname = yang_dnode_get_string(dnode, "./interface");
-       if (yang_dnode_exists(dnode, "./vrf"))
-               vrfname = yang_dnode_get_string(dnode, "./vrf");
+       ifname = yang_dnode_get_string(dnode, "./interface");
+       vrfname = yang_dnode_get_string(dnode, "./vrf");
 
        /* Generate the corresponding key. */
        gen_bfd_key(bk, &psa, &lsa, mhop, ifname, vrfname);
@@ -72,15 +69,7 @@ static int bfd_session_create(enum nb_event event, const struct lyd_node *dnode,
                 */
                yang_dnode_get_prefix(&p, dnode, "./dest-addr");
 
-               /*
-                * To support old FRR versions we must allow empty
-                * interface to be specified, however that should
-                * change in the future.
-                */
-               if (yang_dnode_exists(dnode, "./interface"))
-                       ifname = yang_dnode_get_string(dnode, "./interface");
-               else
-                       ifname = "";
+               ifname = yang_dnode_get_string(dnode, "./interface");
 
                if (p.family == AF_INET6 && IN6_IS_ADDR_LINKLOCAL(&p.u.prefix6)
                    && strlen(ifname) == 0) {