aboutsummaryrefslogtreecommitdiffstats
path: root/src/vlibmemory/memory_api.c
diff options
context:
space:
mode:
authorDave Barach <dave@barachs.net>2018-10-17 10:38:51 -0400
committerDamjan Marion <dmarion@me.com>2018-10-23 13:06:46 +0000
commitb7b929931a07fbb27b43d5cd105f366c3e29807e (patch)
tree438681c89738802dbb5d339715b96ea2c31bafb4 /src/vlibmemory/memory_api.c
parentb9a4c445c1d4e9cdab476a8e1fb8a46ff0fc6080 (diff)
c11 safe string handling support
Change-Id: Ied34720ca5a6e6e717eea4e86003e854031b6eab Signed-off-by: Dave Barach <dave@barachs.net>
Diffstat (limited to 'src/vlibmemory/memory_api.c')
-rw-r--r--src/vlibmemory/memory_api.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/vlibmemory/memory_api.c b/src/vlibmemory/memory_api.c
index 1f5da4c786e..a444ec785a7 100644
--- a/src/vlibmemory/memory_api.c
+++ b/src/vlibmemory/memory_api.c
@@ -127,7 +127,7 @@ vl_api_memclnt_create_internal (char *name, svm_queue_t * q)
*regpp = clib_mem_alloc (sizeof (vl_api_registration_t));
regp = *regpp;
- memset (regp, 0, sizeof (*regp));
+ clib_memset (regp, 0, sizeof (*regp));
regp->registration_type = REGISTRATION_TYPE_SHMEM;
regp->vl_api_registration_pool_index = regpp - am->vl_clients;
regp->vlib_rp = svm;
@@ -194,7 +194,7 @@ vl_api_memclnt_create_t_handler (vl_api_memclnt_create_t * mp)
*regpp = clib_mem_alloc (sizeof (vl_api_registration_t));
regp = *regpp;
- memset (regp, 0, sizeof (*regp));
+ clib_memset (regp, 0, sizeof (*regp));
regp->registration_type = REGISTRATION_TYPE_SHMEM;
regp->vl_api_registration_pool_index = regpp - am->vl_clients;
regp->vlib_rp = svm;
@@ -346,7 +346,7 @@ vl_api_memclnt_delete_t_handler (vl_api_memclnt_delete_t * mp)
oldheap = svm_push_data_heap (svm);
vec_free (regp->name);
/* Poison the old registration */
- memset (regp, 0xF1, sizeof (*regp));
+ clib_memset (regp, 0xF1, sizeof (*regp));
clib_mem_free (regp);
pthread_mutex_unlock (&svm->mutex);
svm_pop_heap (oldheap);
@@ -400,7 +400,7 @@ vl_api_memclnt_keepalive_t_handler (vl_api_memclnt_keepalive_t * mp)
shmem_hdr = am->shmem_hdr;
rmp = vl_msg_api_alloc_as_if_client (sizeof (*rmp));
- memset (rmp, 0, sizeof (*rmp));
+ clib_memset (rmp, 0, sizeof (*rmp));
rmp->_vl_msg_id = ntohs (VL_API_MEMCLNT_KEEPALIVE_REPLY);
rmp->context = mp->context;
vl_msg_api_send_shmem (shmem_hdr->vl_input_queue, (u8 *) & rmp);
@@ -425,7 +425,7 @@ vl_mem_api_init (const char *region_name)
vl_shmem_hdr_t *shm;
vlib_main_t *vm = vlib_get_main ();
- memset (c, 0, sizeof (*c));
+ clib_memset (c, 0, sizeof (*c));
if ((rv = vl_map_shmem (region_name, 1 /* is_vlib */ )) < 0)
return rv;
@@ -513,7 +513,7 @@ send_memclnt_keepalive (vl_api_registration_t * regp, f64 now)
am->shmem_hdr = regp->shmem_hdr;
mp = vl_msg_api_alloc (sizeof (*mp));
- memset (mp, 0, sizeof (*mp));
+ clib_memset (mp, 0, sizeof (*mp));
mp->_vl_msg_id = clib_host_to_net_u16 (VL_API_MEMCLNT_KEEPALIVE);
mp->context = mp->client_index =
vl_msg_api_handle_from_index_and_epoch
@@ -658,7 +658,7 @@ vl_mem_api_dead_client_scan (api_main_t * am, vl_shmem_hdr_t * shm, f64 now)
else
{
/* Poison the old registration */
- memset (*regpp, 0xF3, sizeof (**regpp));
+ clib_memset (*regpp, 0xF3, sizeof (**regpp));
clib_mem_free (*regpp);
}
/* no dangling references, please */
@@ -899,7 +899,7 @@ vlibmemory_init (vlib_main_t * vm)
svm_map_region_args_t _a, *a = &_a;
clib_error_t *error;
- memset (a, 0, sizeof (*a));
+ clib_memset (a, 0, sizeof (*a));
a->root_path = am->root_path;
a->name = SVM_GLOBAL_REGION_NAME;
a->baseva = (am->global_baseva != 0) ?