summaryrefslogtreecommitdiffstats
path: root/src/vnet/session/session_cli.c
diff options
context:
space:
mode:
authorDave Wallace <dwallacelf@gmail.com>2017-10-26 03:29:30 -0400
committerFlorin Coras <florin.coras@gmail.com>2017-10-26 15:01:50 +0000
commit8af2054b7899f7f457101b4ceffb90c5beac0bb0 (patch)
tree30a0692dcdd9faf1a1f6f77c1a6403b2163de910 /src/vnet/session/session_cli.c
parentca514fda1125573d513215cb6ea7f22057a82d6b (diff)
VCL: add session namespace support.
Change-Id: I04f1b63e66260d99c0dd180b0295a55a9b750df7 Signed-off-by: Dave Wallace <dwallacelf@gmail.com>
Diffstat (limited to 'src/vnet/session/session_cli.c')
-rwxr-xr-xsrc/vnet/session/session_cli.c20
1 files changed, 15 insertions, 5 deletions
diff --git a/src/vnet/session/session_cli.c b/src/vnet/session/session_cli.c
index f0f490daa21..95fc48d75df 100755
--- a/src/vnet/session/session_cli.c
+++ b/src/vnet/session/session_cli.c
@@ -455,19 +455,29 @@ static clib_error_t *
session_enable_disable_fn (vlib_main_t * vm, unformat_input_t * input,
vlib_cli_command_t * cmd)
{
+ unformat_input_t _line_input, *line_input = &_line_input;
u8 is_en = 1;
+ clib_error_t *error;
- while (unformat_check_input (input) != UNFORMAT_END_OF_INPUT)
+ if (!unformat_user (input, unformat_line_input, line_input))
+ return 0;
+
+ while (unformat_check_input (line_input) != UNFORMAT_END_OF_INPUT)
{
- if (unformat (input, "enable"))
+ if (unformat (line_input, "enable"))
is_en = 1;
- else if (unformat (input, "disable"))
+ else if (unformat (line_input, "disable"))
is_en = 0;
else
- return clib_error_return (0, "unknown input `%U'",
- format_unformat_error, input);
+ {
+ error = clib_error_return (0, "unknown input `%U'",
+ format_unformat_error, line_input);
+ unformat_free (line_input);
+ return error;
+ }
}
+ unformat_free (line_input);
return vnet_session_enable_disable (vm, is_en);
}