summaryrefslogtreecommitdiffstats
path: root/src/vlibapi
diff options
context:
space:
mode:
Diffstat (limited to 'src/vlibapi')
-rw-r--r--src/vlibapi/vat_helper_macros.h13
1 files changed, 8 insertions, 5 deletions
diff --git a/src/vlibapi/vat_helper_macros.h b/src/vlibapi/vat_helper_macros.h
index 2e1b9422bf7..1dd597cce96 100644
--- a/src/vlibapi/vat_helper_macros.h
+++ b/src/vlibapi/vat_helper_macros.h
@@ -65,13 +65,16 @@ do { \
#define PING(_tm, mp_ping) \
do \
{ \
- if (!(_tm)->ping_id) \
- (_tm)->ping_id = \
- vl_msg_api_get_msg_index ((u8 *) (VL_API_CONTROL_PING_CRC)); \
- mp_ping = vl_msg_api_alloc_as_if_client (sizeof (*mp_ping)); \
- mp_ping->_vl_msg_id = htons ((_tm)->ping_id); \
+ socket_client_main_t *scm = vam->socket_client_main; \
+ if (scm && scm->socket_enable) \
+ mp_ping = vl_socket_client_msg_alloc (sizeof (*mp_ping)); \
+ else \
+ mp_ping = vl_msg_api_alloc_as_if_client (sizeof (*mp_ping)); \
+ mp_ping->_vl_msg_id = htons (VL_API_CONTROL_PING + 1); \
mp_ping->client_index = vam->my_client_index; \
vam->result_ready = 0; \
+ if (scm) \
+ scm->control_pings_outstanding++; \
} \
while (0);