In some situations we already know the ifp and by extension
the ifindex there is no need to look it up for every
route we send to zebra.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
->ifindex;
if (!ifindex) {
- if (mpinfo->peer->conf_if
- || mpinfo->peer->ifname)
+ if (mpinfo->peer->conf_if)
+ ifindex = mpinfo->peer->ifp->ifindex;
+ else if (mpinfo->peer->ifname)
ifindex = ifname2ifindex(
- mpinfo->peer->conf_if
- ? mpinfo->peer->conf_if
- : mpinfo->peer->ifname,
+ mpinfo->peer->ifname,
bgp->vrf_id);
else if (mpinfo->peer->nexthop.ifp)
ifindex = mpinfo->peer->nexthop.ifp