if_lookup_by_index_all_vrf doesn't work correctly with netns VRF backend
as the same index may be used in multiple netns simultaneously.
We always know the BGP instance we work with, so use its VRF id for the
interface lookup.
Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
static int bgp_nht_ifp_initial(struct thread *thread)
{
ifindex_t ifindex = THREAD_VAL(thread);
- struct interface *ifp = if_lookup_by_index_all_vrf(ifindex);
+ struct bgp *bgp = THREAD_ARG(thread);
+ struct interface *ifp = if_lookup_by_index(ifindex, bgp->vrf_id);
if (!ifp)
return 0;
return;
if (bnc->ifindex)
- thread_add_event(bm->master, bgp_nht_ifp_initial, NULL,
+ thread_add_event(bm->master, bgp_nht_ifp_initial, bnc->bgp,
bnc->ifindex, NULL);
}