mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-08-07 05:42:21 +00:00
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 <philippe.guibert@6wind.com>
This commit is contained in:
parent
71c4e0c59b
commit
2569910bb6
@ -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
|
vrf_id_t vrf_id = VRF_DEFAULT; // Pending: need a way to return invalid
|
||||||
// id/ routine not used.
|
// id/ routine not used.
|
||||||
|
|
||||||
|
if (!name)
|
||||||
|
return vrf_id;
|
||||||
vrf = vrf_lookup_by_name(name);
|
vrf = vrf_lookup_by_name(name);
|
||||||
if (vrf)
|
if (vrf)
|
||||||
vrf_id = vrf->vrf_id;
|
vrf_id = vrf->vrf_id;
|
||||||
|
Loading…
Reference in New Issue
Block a user