summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--vpp/vpp-api/api.c21
1 files changed, 18 insertions, 3 deletions
diff --git a/vpp/vpp-api/api.c b/vpp/vpp-api/api.c
index 3840b820aa9..ca56ab24480 100644
--- a/vpp/vpp-api/api.c
+++ b/vpp/vpp-api/api.c
@@ -170,13 +170,29 @@ do { \
#define REPLY_MACRO3(t, n, body) \
do { \
unix_shared_memory_queue_t * q; \
- u8 is_error = 0; \
rv = vl_msg_api_pd_handler (mp, rv); \
q = vl_api_client_index_to_input_queue (mp->client_index); \
if (!q) \
return; \
\
rmp = vl_msg_api_alloc (sizeof (*rmp) + n); \
+ rmp->_vl_msg_id = ntohs((t)); \
+ rmp->context = mp->context; \
+ rmp->retval = ntohl(rv); \
+ do {body;} while (0); \
+ vl_msg_api_send_shmem (q, (u8 *)&rmp); \
+} while(0);
+
+#define REPLY_MACRO4(t, n, body) \
+do { \
+ unix_shared_memory_queue_t * q; \
+ u8 is_error = 0; \
+ rv = vl_msg_api_pd_handler (mp, rv); \
+ q = vl_api_client_index_to_input_queue (mp->client_index); \
+ if (!q) \
+ return; \
+ \
+ rmp = vl_msg_api_alloc_or_null (sizeof (*rmp) + n); \
if (!rmp) \
{ \
/* if there isn't enough memory, try to allocate */ \
@@ -189,7 +205,6 @@ do { \
rv = VNET_API_ERROR_TABLE_TOO_BIG; \
is_error = 1; \
} \
- \
rmp->_vl_msg_id = ntohs((t)); \
rmp->context = mp->context; \
rmp->retval = ntohl(rv); \
@@ -6093,7 +6108,7 @@ vl_api_lisp_adjacencies_get_t_handler (vl_api_lisp_adjacencies_get_t * mp)
size = vec_len (adjs) * sizeof (a);
/* *INDENT-OFF* */
- REPLY_MACRO3 (VL_API_LISP_ADJACENCIES_GET_REPLY, size,
+ REPLY_MACRO4 (VL_API_LISP_ADJACENCIES_GET_REPLY, size,
{
rmp->count = clib_host_to_net_u32 (vec_len (adjs));
lisp_adjacency_copy (rmp->adjacencies, adjs);