]> git.puffer.fish Git - matthieu/frr.git/commitdiff
zebra: Nexthop APIs to use correct vrf_id
authorChirag Shah <chirag@cumulusnetworks.com>
Sat, 23 Sep 2017 17:44:16 +0000 (10:44 -0700)
committerChirag Shah <chirag@cumulusnetworks.com>
Mon, 25 Sep 2017 01:05:12 +0000 (18:05 -0700)
For unnumbered interface lookup vrf aware interface
info.
Pass vrf aware interface info for route entry's nexthop
ifindex in route add path.

Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
zebra/zebra_rib.c

index bb496633191a3934b06964ea52a8d8144960c49e..6f203fcf5c13c66272da6fe6a2f62f0be712f5e0 100644 (file)
@@ -261,7 +261,7 @@ struct nexthop *route_entry_nexthop_ipv4_ifindex_add(struct route_entry *re,
        if (src)
                nexthop->src.ipv4 = *src;
        nexthop->ifindex = ifindex;
-       ifp = if_lookup_by_index(nexthop->ifindex, VRF_DEFAULT);
+       ifp = if_lookup_by_index(nexthop->ifindex, re->vrf_id);
        /*Pending: need to think if null ifp here is ok during bootup?
          There was a crash because ifp here was coming to be NULL */
        if (ifp)
@@ -417,7 +417,7 @@ static int nexthop_active(afi_t afi, struct route_entry *re,
         * address in the routing table.
         */
        if (CHECK_FLAG(nexthop->flags, NEXTHOP_FLAG_ONLINK)) {
-               ifp = if_lookup_by_index(nexthop->ifindex, VRF_DEFAULT);
+               ifp = if_lookup_by_index(nexthop->ifindex, re->vrf_id);
                if (ifp && connected_is_unnumbered(ifp)) {
                        if (if_is_operative(ifp))
                                return 1;