From: Igor Ryzhov Date: Thu, 24 Sep 2020 17:23:21 +0000 (+0300) Subject: bfdd: interface and vrf are mandatory leafs X-Git-Tag: base_7.6~492^2~1 X-Git-Url: https://git.puffer.fish/?a=commitdiff_plain;h=2e8d292578470f1508f976caf46414cd2aefe79c;p=mirror%2Ffrr.git bfdd: interface and vrf are mandatory leafs Signed-off-by: Igor Ryzhov --- 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) {