From 264080855e4b33cef5cb19a948f2df2ae597073f Mon Sep 17 00:00:00 2001 From: Florin Coras Date: Thu, 9 Nov 2017 02:06:07 -0800 Subject: session: fix app ns list cli dump Change-Id: I9b0a4676d088bc7587d12023fc3a3ea53aeaba20 Signed-off-by: Florin Coras --- src/vnet/session/application_namespace.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/vnet/session/application_namespace.c b/src/vnet/session/application_namespace.c index 700f83980ba..eaf09e8e369 100644 --- a/src/vnet/session/application_namespace.c +++ b/src/vnet/session/application_namespace.c @@ -260,12 +260,15 @@ show_app_ns_fn (vlib_main_t * vm, unformat_input_t * main_input, unformat_input_t _line_input, *line_input = &_line_input; app_namespace_t *app_ns; session_table_t *st; - u8 *ns_id, do_table = 0; + u8 *ns_id, do_table = 0, had_input = 1; session_cli_return_if_not_enabled (); if (!unformat_user (main_input, unformat_line_input, line_input)) - return 0; + { + had_input = 0; + goto do_ns_list; + } while (unformat_check_input (line_input) != UNFORMAT_END_OF_INPUT) { @@ -300,7 +303,7 @@ show_app_ns_fn (vlib_main_t * vm, unformat_input_t * main_input, vlib_cli_output (vm, "%-20s%-20s%-20s", "Namespace", "Secret", "sw_if_index"); - +do_ns_list: /* *INDENT-OFF* */ pool_foreach (app_ns, app_namespace_pool, ({ vlib_cli_output (vm, "%U", format_app_namespace, app_ns); @@ -308,7 +311,8 @@ show_app_ns_fn (vlib_main_t * vm, unformat_input_t * main_input, /* *INDENT-ON* */ done: - unformat_free (line_input); + if (had_input) + unformat_free (line_input); return 0; } -- cgit 1.2.3-korg