diff options
author | 2024-11-18 12:08:57 -0800 | |
---|---|---|
committer | 2024-12-23 21:28:08 +0000 | |
commit | 6d4dbd4f29d6789cf4ea799d0b2eb9d489fa339d (patch) | |
tree | 3c1b6b1d56bd86a1d6a99e36c020a81f54a43f8b /src/vnet/session/session_cli.c | |
parent | 755690c6c31671bdce4771db04199e151c32c5d0 (diff) |
session: add auto sdl
New CLI to enable/disable auto-sdl (requires session enable rt-backend sdl)
auto-sdl <enable|disable> [threshold <n>] [remove-timeout <t>]
threshold is defined as the number of packets before the SDL entry is created to deny the source.
remove-timeout is defined as the duration to remove the SDL entry which was created earlier.
Type: feature
Change-Id: I513094a59663970beae33257006c652674643764
Signed-off-by: Steven Luong <sluong@cisco.com>
Diffstat (limited to 'src/vnet/session/session_cli.c')
-rw-r--r-- | src/vnet/session/session_cli.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/vnet/session/session_cli.c b/src/vnet/session/session_cli.c index 0ed2876469b..aff102a6989 100644 --- a/src/vnet/session/session_cli.c +++ b/src/vnet/session/session_cli.c @@ -976,7 +976,7 @@ static clib_error_t * session_enable_disable_fn (vlib_main_t * vm, unformat_input_t * input, vlib_cli_command_t * cmd) { - session_enable_disable_args_t args; + session_enable_disable_args_t args = {}; session_main_t *smm = &session_main; while (unformat_check_input (input) != UNFORMAT_END_OF_INPUT) @@ -1010,6 +1010,9 @@ session_enable_disable_fn (vlib_main_t * vm, unformat_input_t * input, return clib_error_return ( 0, "session is already enable. Must disable first"); + if ((smm->is_enabled == 0) && (args.is_en == 0)) + return clib_error_return (0, "session is already disabled"); + return vnet_session_enable_disable (vm, &args); } |