summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNeale Ranns <neale.ranns@cisco.com>2018-07-30 11:59:22 -0700
committerNeale Ranns <nranns@cisco.com>2018-08-01 07:38:16 +0000
commit78c70776340174a2e2c289f16c8c73395f9db289 (patch)
tree0ef549f8e9b54b29ab951cd2b0e422a458ee5316
parentdb6d6b3058a20a53684536f68f0b8dc13633f6b4 (diff)
fix 'sh vxlan tunnels'
this receipe: /* Get a line of input. */ if (!unformat_user (input, unformat_line_input, line_input)) return 0; only works if there is more data following the registered command name. So it is not so good for show commands... Change-Id: I54249865a44526ade4b40e2d6207138a2d056e40 Signed-off-by: Neale Ranns <neale.ranns@cisco.com> (cherry picked from commit 16be62e3846750b5b7921c0b4d6408477be434f7)
-rw-r--r--src/vnet/vxlan/vxlan.c19
1 files changed, 4 insertions, 15 deletions
diff --git a/src/vnet/vxlan/vxlan.c b/src/vnet/vxlan/vxlan.c
index f0312bed9b1..ce565541a37 100644
--- a/src/vnet/vxlan/vxlan.c
+++ b/src/vnet/vxlan/vxlan.c
@@ -851,30 +851,19 @@ show_vxlan_tunnel_command_fn (vlib_main_t * vm,
unformat_input_t * input,
vlib_cli_command_t * cmd)
{
- unformat_input_t _line_input, *line_input = &_line_input;
vxlan_main_t *vxm = &vxlan_main;
vxlan_tunnel_t *t;
int raw = 0;
- clib_error_t *parse_error = NULL;
-
- /* Get a line of input. */
- if (!unformat_user (input, unformat_line_input, line_input))
- return 0;
- while (unformat_check_input (line_input) != UNFORMAT_END_OF_INPUT)
+ while (unformat_check_input (input) != UNFORMAT_END_OF_INPUT)
{
- if (unformat (line_input, "raw"))
+ if (unformat (input, "raw"))
raw = 1;
else
- parse_error = clib_error_return (0, "parse error: '%U'",
- format_unformat_error, line_input);
+ return clib_error_return (0, "parse error: '%U'",
+ format_unformat_error, input);
}
- unformat_free (line_input);
-
- if (parse_error)
- return parse_error;
-
if (pool_elts (vxm->tunnels) == 0)
vlib_cli_output (vm, "No vxlan tunnels configured...");