lib: remove if_lookup_by_index portion of code with unknown vrf

This function should be called with a known vrf_id. All other cases, the
other API should be called.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
This commit is contained in:
Philippe Guibert 2018-07-10 14:34:44 +02:00
parent 86f07f44c1
commit fda8229965

View File

@ -222,18 +222,6 @@ struct interface *if_lookup_by_index(ifindex_t ifindex, vrf_id_t vrf_id)
struct vrf *vrf;
struct interface if_tmp;
if (vrf_id == VRF_UNKNOWN) {
struct interface *ifp;
RB_FOREACH (vrf, vrf_id_head, &vrfs_by_id) {
ifp = if_lookup_by_index(ifindex, vrf->vrf_id);
if (ifp)
return ifp;
}
return NULL;
}
vrf = vrf_lookup_by_id(vrf_id);
if (!vrf)
return NULL;