summaryrefslogtreecommitdiff
path: root/zebra/zebra_ptm.c
diff options
context:
space:
mode:
authorG. Paul Ziemba <p-fbsd-bugs@ziemba.us>2021-08-10 10:28:36 -0700
committerG. Paul Ziemba <p-fbsd-bugs@ziemba.us>2021-09-07 09:47:24 -0700
commita383d4d2016585c08c32b2b7426f454030df2f23 (patch)
tree60b9fbfa1b074f82c95e195707aaa4483207b564 /zebra/zebra_ptm.c
parent4250098311f4e6ca9da45ceed9e270c1cba6fba7 (diff)
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 'zebra/zebra_ptm.c')
-rw-r--r--zebra/zebra_ptm.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/zebra/zebra_ptm.c b/zebra/zebra_ptm.c
index 7e9382518f..e17465b112 100644
--- a/zebra/zebra_ptm.c
+++ b/zebra/zebra_ptm.c
@@ -520,7 +520,13 @@ static int zebra_ptm_handle_bfd_msg(void *arg, void *in_ctxt,
if (!strcmp(ZEBRA_PTM_INVALID_VRF, vrf_str) && ifp) {
vrf_id = ifp->vrf_id;
} else {
- vrf_id = vrf_name_to_id(vrf_str);
+ struct vrf *pVrf;
+
+ pVrf = vrf_lookup_by_name(vrf_str);
+ if (pVrf)
+ vrf_id = pVrf->vrf_id;
+ else
+ vrf_id = VRF_DEFAULT;
}
if (!strcmp(bfdst_str, ZEBRA_PTM_BFDSTATUS_DOWN_STR)) {