The interface lookup algorithm is different according to if we are on
netns vrf or not. If we are on the former case, then we only have to
parse the interfaces of the netns, while if we are on the other case, we
have to parse all the interfaces of all the vrfs ( since index is not
overlapping in the latter case).
Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
memcpy(&nh.gate, gate, sz);
if (index) {
- ifp = if_lookup_by_index(index, VRF_UNKNOWN);
+ ifp = if_lookup_by_index_per_ns(
+ zebra_ns_lookup(ns_id),
+ index);
if (ifp)
nh_vrf_id = ifp->vrf_id;
}
* using the last one looked
* up right now
*/
- ifp = if_lookup_by_index(index,
- VRF_UNKNOWN);
+ ifp = if_lookup_by_index_per_ns(
+ zebra_ns_lookup(ns_id),
+ index);
if (ifp)
nh_vrf_id = ifp->vrf_id;
else {