From 2569910bb6e5c00ececc60ed15b182e14a88cb9d Mon Sep 17 00:00:00 2001 From: Philippe Guibert Date: Tue, 20 Nov 2018 10:30:47 +0100 Subject: [PATCH] lib: enforce vrf_name_to_id by returning default_vrf when name is null in order to enforce the vrf_id to return, from a vrf name, a check is done on the vrf_name_to_id callback. Signed-off-by: Philippe Guibert --- lib/vrf.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/vrf.c b/lib/vrf.c index 8409a1c9a1..0c82f6a3cd 100644 --- a/lib/vrf.c +++ b/lib/vrf.c @@ -330,6 +330,8 @@ vrf_id_t vrf_name_to_id(const char *name) vrf_id_t vrf_id = VRF_DEFAULT; // Pending: need a way to return invalid // id/ routine not used. + if (!name) + return vrf_id; vrf = vrf_lookup_by_name(name); if (vrf) vrf_id = vrf->vrf_id; -- 2.39.5