aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins
diff options
context:
space:
mode:
Diffstat (limited to 'src/plugins')
-rw-r--r--src/plugins/ping/ping_api.c18
1 files changed, 12 insertions, 6 deletions
diff --git a/src/plugins/ping/ping_api.c b/src/plugins/ping/ping_api.c
index 5578fa560f2..a5af1033d0e 100644
--- a/src/plugins/ping/ping_api.c
+++ b/src/plugins/ping/ping_api.c
@@ -122,16 +122,22 @@ vl_api_want_ping_finished_events_t_handler (
while ((sleep_interval =
time_ping_sent + ping_interval - vlib_time_now (vm)) > 0.0)
{
- uword event_type;
+ uword event_count;
vlib_process_wait_for_event_or_clock (vm, sleep_interval);
- event_type = vlib_process_get_events (vm, 0);
- if (event_type == ~0)
+ if (dst_addr.version == AF_IP4)
+ event_count =
+ vlib_process_get_events_with_type (vm, 0, PING_RESPONSE_IP4);
+ else if (dst_addr.version == AF_IP6)
+ event_count =
+ vlib_process_get_events_with_type (vm, 0, PING_RESPONSE_IP6);
+ else
break;
- if (event_type == PING_RESPONSE_IP4 ||
- event_type == PING_RESPONSE_IP6)
- reply_count += 1;
+ if (event_count == 0)
+ break;
+
+ reply_count += 1;
}
}