From 2e8d292578470f1508f976caf46414cd2aefe79c Mon Sep 17 00:00:00 2001 From: Igor Ryzhov Date: Thu, 24 Sep 2020 20:23:21 +0300 Subject: [PATCH] bfdd: interface and vrf are mandatory leafs Signed-off-by: Igor Ryzhov --- bfdd/bfdd_nb_config.c | 17 +++-------------- 1 file changed, 3 insertions(+), 14 deletions(-) diff --git a/bfdd/bfdd_nb_config.c b/bfdd/bfdd_nb_config.c index 0046bc625b..b34e06d230 100644 --- a/bfdd/bfdd_nb_config.c +++ b/bfdd/bfdd_nb_config.c @@ -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) { -- 2.39.5