summaryrefslogtreecommitdiffstats
path: root/src/vnet/mpls/mpls_tunnel.c
diff options
context:
space:
mode:
authorNeale Ranns <nranns@cisco.com>2017-08-08 13:07:16 -0700
committerFlorin Coras <florin.coras@gmail.com>2017-08-09 02:04:32 +0000
commitf73d0e2ea6bf4e0dc9c69ec4f1d0c7b9b41d2fa3 (patch)
tree9837612f6ee19e88e73a6e87163e55f44f1aead7 /src/vnet/mpls/mpls_tunnel.c
parenta3a3a9dedd6af147a310fa5830a52f771e1448bb (diff)
Allow multiple MPLS output labels to be passed on the CLI
Change-Id: Ib5af105e32b6b0df86923e189ab6bf6ee59de5b9 Signed-off-by: Neale Ranns <nranns@cisco.com>
Diffstat (limited to 'src/vnet/mpls/mpls_tunnel.c')
-rw-r--r--src/vnet/mpls/mpls_tunnel.c23
1 files changed, 18 insertions, 5 deletions
diff --git a/src/vnet/mpls/mpls_tunnel.c b/src/vnet/mpls/mpls_tunnel.c
index 6452a60bfe2..5211c926055 100644
--- a/src/vnet/mpls/mpls_tunnel.c
+++ b/src/vnet/mpls/mpls_tunnel.c
@@ -800,11 +800,24 @@ vnet_create_mpls_tunnel_command_fn (vlib_main_t * vm,
is_del = 0;
else if (unformat (line_input, "add"))
is_del = 0;
- else if (unformat (line_input, "out-label %U",
- unformat_mpls_unicast_label, &out_label))
- {
- vec_add1(rpath.frp_label_stack, out_label);
- }
+ else if (unformat (line_input, "out-labels"))
+ {
+ if (vec_len (rpaths) == 0)
+ {
+ error = clib_error_return (0, "Paths then labels");
+ goto done;
+ }
+ else
+ {
+ while (unformat (line_input, "%U",
+ unformat_mpls_unicast_label,
+ &out_label))
+ {
+ vec_add1 (rpaths[vec_len (rpaths) - 1].frp_label_stack,
+ out_label);
+ }
+ }
+ }
else if (unformat (line_input, "via %U %U",
unformat_ip4_address,
&rpath.frp_addr.ip4,