]> git.puffer.fish Git - mirror/frr.git/commitdiff
lib: enforce vrf_name_to_id by returning default_vrf when name is null
authorPhilippe Guibert <philippe.guibert@6wind.com>
Tue, 20 Nov 2018 09:30:47 +0000 (10:30 +0100)
committerPhilippe Guibert <philippe.guibert@6wind.com>
Fri, 28 Dec 2018 17:18:40 +0000 (18:18 +0100)
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 <philippe.guibert@6wind.com>
lib/vrf.c

index 8409a1c9a13ed5e9bb4febd561d3c0e637ef8cd2..0c82f6a3cd451a4dda81f4605f62ef544ef47d7a 100644 (file)
--- 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;