diff options
author | Neale Ranns <nranns@cisco.com> | 2018-08-30 06:12:27 -0700 |
---|---|---|
committer | Neale Ranns <nranns@cisco.com> | 2018-08-31 09:03:07 +0000 |
commit | 2da975c4dde45b1421998e54c107cb24d01d10d9 (patch) | |
tree | 2b26f835004209c611a846223d341a78d053a0e8 /src/vnet/mpls/mpls_api.c | |
parent | fe47e29fc6ddcb664f76f4ebbfd2593cb0282e43 (diff) |
SR-MPLS: fixes and tests
- the FIB path takes a vector of type fib_mpls_label_t not u32 so the untype safe vec_add did not work
- write som eSR-MPLS tests
- allow an MPLS tunnel to resolve through a SR BSID
Change-Id: I2a18b9a9bf43584100ac269c4ebc286c9e3b3ea5
Signed-off-by: Neale Ranns <nranns@cisco.com>
(cherry picked from commit 7c922dc404c2c0a2d67d53ca05db1c1ae1598f44)
Diffstat (limited to 'src/vnet/mpls/mpls_api.c')
-rw-r--r-- | src/vnet/mpls/mpls_api.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/vnet/mpls/mpls_api.c b/src/vnet/mpls/mpls_api.c index 9f5100a7f83..47a3408520e 100644 --- a/src/vnet/mpls/mpls_api.c +++ b/src/vnet/mpls/mpls_api.c @@ -306,6 +306,7 @@ vl_api_mpls_tunnel_add_del_t_handler (vl_api_mpls_tunnel_add_del_t * mp) u32 tunnel_sw_if_index; int ii; fib_route_path_t rpath, *rpaths = NULL; + u32 next_hop_via_label; memset (&rpath, 0, sizeof (rpath)); @@ -326,6 +327,14 @@ vl_api_mpls_tunnel_add_del_t_handler (vl_api_mpls_tunnel_add_del_t * mp) rpath.frp_sw_if_index = ntohl (mp->mt_next_hop_sw_if_index); rpath.frp_weight = 1; + next_hop_via_label = ntohl (mp->mt_next_hop_via_label); + if ((MPLS_LABEL_INVALID != next_hop_via_label) && (0 != next_hop_via_label)) + { + rpath.frp_proto = DPO_PROTO_MPLS; + rpath.frp_local_label = next_hop_via_label; + rpath.frp_eos = MPLS_NON_EOS; + } + if (mp->mt_is_add) { for (ii = 0; ii < mp->mt_next_hop_n_out_labels; ii++) |