diff options
| author | Donald Sharp <sharpd@cumulusnetworks.com> | 2018-02-08 09:12:12 -0500 |
|---|---|---|
| committer | Donald Sharp <sharpd@cumulusnetworks.com> | 2018-02-08 19:35:53 -0500 |
| commit | 4a7371e9e21569eee0e728f64ea06870d1aafa5e (patch) | |
| tree | 15d90068bac9ca5259e6e63b5df7cac7747df08f /zebra/zebra_mpls.c | |
| parent | a97e5c1a8075fcab9d9e0edb453167752fc3e2b9 (diff) | |
*: Track vrfs per nexthop not per route entry
Track the vfrs on a per nexthop basis instead
of on a per route entry basis.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Diffstat (limited to 'zebra/zebra_mpls.c')
| -rw-r--r-- | zebra/zebra_mpls.c | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/zebra/zebra_mpls.c b/zebra/zebra_mpls.c index 22c81b5784..485488d567 100644 --- a/zebra/zebra_mpls.c +++ b/zebra/zebra_mpls.c @@ -614,7 +614,7 @@ static int nhlfe_nexthop_active_ipv4(zebra_nhlfe_t *nhlfe, struct route_entry *match; struct nexthop *match_nh; - table = zebra_vrf_table(AFI_IP, SAFI_UNICAST, VRF_DEFAULT); + table = zebra_vrf_table(AFI_IP, SAFI_UNICAST, nexthop->vrf_id); if (!table) return 0; @@ -663,7 +663,7 @@ static int nhlfe_nexthop_active_ipv6(zebra_nhlfe_t *nhlfe, struct route_node *rn; struct route_entry *match; - table = zebra_vrf_table(AFI_IP6, SAFI_UNICAST, VRF_DEFAULT); + table = zebra_vrf_table(AFI_IP6, SAFI_UNICAST, nexthop->vrf_id); if (!table) return 0; @@ -728,7 +728,8 @@ static int nhlfe_nexthop_active(zebra_nhlfe_t *nhlfe) case NEXTHOP_TYPE_IPV6_IFINDEX: if (IN6_IS_ADDR_LINKLOCAL(&nexthop->gate.ipv6)) { - ifp = if_lookup_by_index(nexthop->ifindex, VRF_DEFAULT); + ifp = if_lookup_by_index(nexthop->ifindex, + nexthop->vrf_id); if (ifp && if_is_operative(ifp)) SET_FLAG(nexthop->flags, NEXTHOP_FLAG_ACTIVE); else @@ -1149,6 +1150,7 @@ static zebra_nhlfe_t *nhlfe_add(zebra_lsp_t *lsp, enum lsp_types_t lsp_type, } nexthop_add_labels(nexthop, lsp_type, 1, &out_label); + nexthop->vrf_id = VRF_DEFAULT; nexthop->type = gtype; switch (nexthop->type) { case NEXTHOP_TYPE_IPV4: @@ -1324,9 +1326,9 @@ static json_object *nhlfe_json(zebra_nhlfe_t *nhlfe) inet_ntop(AF_INET6, &nexthop->gate.ipv6, buf, BUFSIZ)); if (nexthop->ifindex) - json_object_string_add( - json_nhlfe, "interface", - ifindex2ifname(nexthop->ifindex, VRF_DEFAULT)); + json_object_string_add(json_nhlfe, "interface", + ifindex2ifname(nexthop->ifindex, + nexthop->vrf_id)); break; default: break; @@ -1356,7 +1358,8 @@ static void nhlfe_print(zebra_nhlfe_t *nhlfe, struct vty *vty) vty_out(vty, " via %s", inet_ntoa(nexthop->gate.ipv4)); if (nexthop->ifindex) vty_out(vty, " dev %s", - ifindex2ifname(nexthop->ifindex, VRF_DEFAULT)); + ifindex2ifname(nexthop->ifindex, + nexthop->vrf_id)); break; case NEXTHOP_TYPE_IPV6: case NEXTHOP_TYPE_IPV6_IFINDEX: @@ -1364,7 +1367,8 @@ static void nhlfe_print(zebra_nhlfe_t *nhlfe, struct vty *vty) inet_ntop(AF_INET6, &nexthop->gate.ipv6, buf, BUFSIZ)); if (nexthop->ifindex) vty_out(vty, " dev %s", - ifindex2ifname(nexthop->ifindex, VRF_DEFAULT)); + ifindex2ifname(nexthop->ifindex, + nexthop->vrf_id)); break; default: break; |
