diff options
author | Ivan Shvedunov <ivan4th@gmail.com> | 2021-02-01 14:11:10 +0300 |
---|---|---|
committer | Andrew Yourtchenko <ayourtch@gmail.com> | 2021-02-08 12:32:04 +0000 |
commit | 7f23ecd151be06ac6f234224628ea305c5e0b41c (patch) | |
tree | 7e1c77c1bef2d3fa7f98cafccb3bf86a9b8b161a /src/plugins | |
parent | a91cb45909642978592c7e21a8f6d2da2e44e506 (diff) |
ping: fix aborting on keypress
Type: fix
Currently ping stops on events like SOCKET_READ_EVENT,
which makes it hard to use over e.g. govpp as it aborts
immediately most of the time. With this patch, ping only
stops upon real CLI read / quit events.
Signed-off-by: Ivan Shvedunov <ivan4th@gmail.com>
Change-Id: Id7a8d0b0fdeb7bbc7b85240e398d27bd5199345b
Diffstat (limited to 'src/plugins')
-rw-r--r-- | src/plugins/ping/ping.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/plugins/ping/ping.c b/src/plugins/ping/ping.c index 98add533407..f3e238b9cd7 100644 --- a/src/plugins/ping/ping.c +++ b/src/plugins/ping/ping.c @@ -16,6 +16,7 @@ #include <stddef.h> #include <vlib/vlib.h> +#include <vlib/unix/unix.h> #include <vnet/fib/ip6_fib.h> #include <vnet/fib/ip4_fib.h> #include <vnet/fib/fib_sas.h> @@ -1173,11 +1174,11 @@ run_ping_ip46_address (vlib_main_t * vm, u32 table_id, ip4_address_t * pa4, } } break; - default: + case UNIX_CLI_PROCESS_EVENT_READ_READY: + case UNIX_CLI_PROCESS_EVENT_QUIT: /* someone pressed a key, abort */ vlib_cli_output (vm, "Aborted due to a keypress."); goto double_break; - break; } vec_free (event_data); } |