summaryrefslogtreecommitdiffstats
path: root/eigrpd/eigrp_northbound.c
diff options
context:
space:
mode:
authorG. Paul Ziemba <p-fbsd-bugs@ziemba.us>2021-08-10 19:28:36 +0200
committerG. Paul Ziemba <p-fbsd-bugs@ziemba.us>2021-09-07 18:47:24 +0200
commita383d4d2016585c08c32b2b7426f454030df2f23 (patch)
tree60b9fbfa1b074f82c95e195707aaa4483207b564 /eigrpd/eigrp_northbound.c
parentMerge pull request #9545 from ton31337/feature/disable-addpath-rx (diff)
downloadfrr-a383d4d2016585c08c32b2b7426f454030df2f23.tar.xz
frr-a383d4d2016585c08c32b2b7426f454030df2f23.zip
vrf_name_to_id(): remove
vrf_name_to_id() returned VRF_DEFAULT when the vrf name was unknown, hiding errors. Per community recommendation, vrf_name_to_id() is now removed and the few callers now use vrf_lookup_by_name() directly. Signed-off-by: G. Paul Ziemba <paulz@labn.net>
Diffstat (limited to 'eigrpd/eigrp_northbound.c')
-rw-r--r--eigrpd/eigrp_northbound.c17
1 files changed, 15 insertions, 2 deletions
diff --git a/eigrpd/eigrp_northbound.c b/eigrpd/eigrp_northbound.c
index 482667f63..3ad711164 100644
--- a/eigrpd/eigrp_northbound.c
+++ b/eigrpd/eigrp_northbound.c
@@ -79,6 +79,7 @@ static int eigrpd_instance_create(struct nb_cb_create_args *args)
{
struct eigrp *eigrp;
const char *vrf;
+ struct vrf *pVrf;
vrf_id_t vrfid;
switch (args->event) {
@@ -87,7 +88,12 @@ static int eigrpd_instance_create(struct nb_cb_create_args *args)
break;
case NB_EV_PREPARE:
vrf = yang_dnode_get_string(args->dnode, "./vrf");
- vrfid = vrf_name_to_id(vrf);
+
+ pVrf = vrf_lookup_by_name(vrf);
+ if (pVrf)
+ vrfid = pVrf->vrf_id;
+ else
+ vrfid = VRF_DEFAULT;
eigrp = eigrp_get(yang_dnode_get_uint16(args->dnode, "./asn"),
vrfid);
@@ -719,12 +725,19 @@ static int eigrpd_instance_redistribute_create(struct nb_cb_create_args *args)
struct eigrp *eigrp;
uint32_t proto;
vrf_id_t vrfid;
+ struct vrf *pVrf;
switch (args->event) {
case NB_EV_VALIDATE:
proto = yang_dnode_get_enum(args->dnode, "./protocol");
vrfname = yang_dnode_get_string(args->dnode, "../vrf");
- vrfid = vrf_name_to_id(vrfname);
+
+ pVrf = vrf_lookup_by_name(vrfname);
+ if (pVrf)
+ vrfid = pVrf->vrf_id;
+ else
+ vrfid = VRF_DEFAULT;
+
if (vrf_bitmap_check(zclient->redist[AFI_IP][proto], vrfid))
return NB_ERR_INCONSISTENCY;
break;