diff options
author | Ole Troan <ot@cisco.com> | 2019-08-27 15:05:27 +0200 |
---|---|---|
committer | Ole Trøan <otroan@employees.org> | 2019-08-27 18:04:00 +0000 |
commit | 7adaa226eaa2401d6bb0dfd38a0d943c9645d7dc (patch) | |
tree | 78ffbde9837497a25971464dcd020f77da6e0ca9 /src/vlibmemory/memory_client.c | |
parent | 2cdcd0cf4004b2c0d1d3b891e381aac5735c21f1 (diff) |
api: revert use string type for strings in memclnt.api
This reverts commit 2959d42feb576c0e00c28c4e27658b25f6c783e9.
Lacks client side fixes.
Type: fix
Change-Id: Ib94b18e74325cede41ed1733e57896f17a952526
Signed-off-by: Ole Troan <ot@cisco.com>
Diffstat (limited to 'src/vlibmemory/memory_client.c')
-rw-r--r-- | src/vlibmemory/memory_client.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/src/vlibmemory/memory_client.c b/src/vlibmemory/memory_client.c index 3e1bdff777c..f032ae77d19 100644 --- a/src/vlibmemory/memory_client.c +++ b/src/vlibmemory/memory_client.c @@ -195,7 +195,7 @@ vl_client_connect (const char *name, int ctx_quota, int input_queue_size) mp->_vl_msg_id = ntohs (VL_API_MEMCLNT_CREATE); mp->ctx_quota = ctx_quota; mp->input_queue = (uword) vl_input_queue; - vl_api_to_api_string (strnlen_s (name, 64), name, &mp->name); + strncpy ((char *) mp->name, name, sizeof (mp->name) - 1); vl_msg_api_send_shmem (shmem_hdr->vl_input_queue, (u8 *) & mp); @@ -517,8 +517,7 @@ vl_client_get_first_plugin_msg_id (const char *plugin_name) clib_time_t clib_time; u16 rv = ~0; - size_t plugin_name_len = strnlen_s (plugin_name, 128); - if (plugin_name_len == 128) + if (strlen (plugin_name) + 1 > sizeof (mp->name)) return (rv); clib_memset (&clib_time, 0, sizeof (clib_time)); @@ -539,7 +538,7 @@ vl_client_get_first_plugin_msg_id (const char *plugin_name) clib_memset (mp, 0, sizeof (*mp)); mp->_vl_msg_id = ntohs (VL_API_GET_FIRST_MSG_ID); mp->client_index = am->my_client_index; - vl_api_to_api_string (plugin_name_len, plugin_name, &mp->name); + strncpy ((char *) mp->name, plugin_name, sizeof (mp->name) - 1); if (vl_socket_client_write () <= 0) goto sock_err; @@ -564,7 +563,7 @@ vl_client_get_first_plugin_msg_id (const char *plugin_name) clib_memset (mp, 0, sizeof (*mp)); mp->_vl_msg_id = ntohs (VL_API_GET_FIRST_MSG_ID); mp->client_index = am->my_client_index; - vl_api_to_api_string (plugin_name_len, plugin_name, &mp->name); + strncpy ((char *) mp->name, plugin_name, sizeof (mp->name) - 1); vl_msg_api_send_shmem (am->shmem_hdr->vl_input_queue, (u8 *) & mp); |