diff options
author | Philippe Guibert <philippe.guibert@6wind.com> | 2018-07-05 10:04:48 +0200 |
---|---|---|
committer | Philippe Guibert <philippe.guibert@6wind.com> | 2018-07-10 17:32:36 +0200 |
commit | 86f07f44c12cfc29924041f0f84158f6d3035472 (patch) | |
tree | 6cbf673d1af4bcd8c97bd387a8f36fe46ae642fa /zebra/zebra_mpls.c | |
parent | zebra: pbr rule lookup index adaptation for vrf netns (diff) | |
download | frr-86f07f44c12cfc29924041f0f84158f6d3035472.tar.xz frr-86f07f44c12cfc29924041f0f84158f6d3035472.zip |
zebra: mpls entry interface lookup adaptation for vrf backend
The search algorithm for interface based on ifindex only is adapted to
vrf netns based too. Only the default netns will be used to search the
interface index.
Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
Diffstat (limited to 'zebra/zebra_mpls.c')
-rw-r--r-- | zebra/zebra_mpls.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/zebra/zebra_mpls.c b/zebra/zebra_mpls.c index fe0837a63..cfe208d35 100644 --- a/zebra/zebra_mpls.c +++ b/zebra/zebra_mpls.c @@ -38,6 +38,7 @@ #include "zebra/rib.h" #include "zebra/rt.h" +#include "zebra/interface.h" #include "zebra/zserv.h" #include "zebra/redistribute.h" #include "zebra/debug.h" @@ -704,6 +705,7 @@ static int nhlfe_nexthop_active(zebra_nhlfe_t *nhlfe) { struct nexthop *nexthop; struct interface *ifp; + struct zebra_ns *zns; nexthop = nhlfe->nexthop; if (!nexthop) // unexpected @@ -721,7 +723,8 @@ static int nhlfe_nexthop_active(zebra_nhlfe_t *nhlfe) * which will not be in the default * VRF. So let's look in all of them */ - ifp = if_lookup_by_index(nexthop->ifindex, VRF_UNKNOWN); + zns = zebra_ns_lookup(NS_DEFAULT); + ifp = if_lookup_by_index_per_ns(zns, nexthop->ifindex); if (ifp && if_is_operative(ifp)) SET_FLAG(nexthop->flags, NEXTHOP_FLAG_ACTIVE); else @@ -2752,10 +2755,13 @@ void zebra_mpls_print_lsp_table(struct vty *vty, struct zebra_vrf *zvrf, switch (nexthop->type) { case NEXTHOP_TYPE_IFINDEX: { + struct zebra_ns *zns; struct interface *ifp; - ifp = if_lookup_by_index( - nexthop->ifindex, VRF_UNKNOWN); + zns = zebra_ns_lookup(NS_DEFAULT); + ifp = if_lookup_by_index_per_ns( + zns, + nexthop->ifindex); vty_out(vty, "%15s", ifp->name); break; } |