Check only PING_RESPONSE_IP4 and PING_RESPONSE_IP6
in ping binary API so it doesn't block other binary API
requests while working. (current version of ping binary API
can read other events like SOCKET_READ_EVENT, for example).
Type: fix
Change-Id: Ie7c5c92322af28633680c9c0d60fed739d4e65a0
Signed-off-by: Nikita Skrynnik <[email protected]>
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;
}
}