From 7f23ecd151be06ac6f234224628ea305c5e0b41c Mon Sep 17 00:00:00 2001 From: Ivan Shvedunov Date: Mon, 1 Feb 2021 14:11:10 +0300 Subject: 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 Change-Id: Id7a8d0b0fdeb7bbc7b85240e398d27bd5199345b --- src/plugins/ping/ping.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/plugins/ping/ping.c') 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 #include +#include #include #include #include @@ -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); } -- cgit 1.2.3-korg