From f73d0e2ea6bf4e0dc9c69ec4f1d0c7b9b41d2fa3 Mon Sep 17 00:00:00 2001 From: Neale Ranns Date: Tue, 8 Aug 2017 13:07:16 -0700 Subject: Allow multiple MPLS output labels to be passed on the CLI Change-Id: Ib5af105e32b6b0df86923e189ab6bf6ee59de5b9 Signed-off-by: Neale Ranns --- src/vnet/ip/lookup.c | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'src/vnet/ip/lookup.c') diff --git a/src/vnet/ip/lookup.c b/src/vnet/ip/lookup.c index 41e46070267..4506ae14019 100755 --- a/src/vnet/ip/lookup.c +++ b/src/vnet/ip/lookup.c @@ -408,15 +408,22 @@ vnet_ip_route_cmd (vlib_main_t * vm, rpaths[vec_len (rpaths) - 1].frp_flags |= FIB_ROUTE_PATH_RESOLVE_VIA_ATTACHED; } - else if (unformat (line_input, "out-label %U", - unformat_mpls_unicast_label, &out_label)) + else if (unformat (line_input, "out-labels")) { if (vec_len (rpaths) == 0) { error = clib_error_return (0, "Paths then labels"); goto done; } - vec_add1 (rpaths[vec_len (rpaths) - 1].frp_label_stack, out_label); + 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-label %U", unformat_mpls_unicast_label, &rpath.frp_local_label)) -- cgit 1.2.3-korg