diff options
author | Dave Barach <dave@barachs.net> | 2018-10-17 10:38:51 -0400 |
---|---|---|
committer | Damjan Marion <dmarion@me.com> | 2018-10-23 13:06:46 +0000 |
commit | b7b929931a07fbb27b43d5cd105f366c3e29807e (patch) | |
tree | 438681c89738802dbb5d339715b96ea2c31bafb4 /src/vlibmemory/socket_api.c | |
parent | b9a4c445c1d4e9cdab476a8e1fb8a46ff0fc6080 (diff) |
c11 safe string handling support
Change-Id: Ied34720ca5a6e6e717eea4e86003e854031b6eab
Signed-off-by: Dave Barach <dave@barachs.net>
Diffstat (limited to 'src/vlibmemory/socket_api.c')
-rw-r--r-- | src/vlibmemory/socket_api.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/vlibmemory/socket_api.c b/src/vlibmemory/socket_api.c index f3cd169d2c0..3cf2a1cfe74 100644 --- a/src/vlibmemory/socket_api.c +++ b/src/vlibmemory/socket_api.c @@ -381,7 +381,7 @@ socksvr_file_add (clib_file_main_t * fm, int fd) clib_file_t template = { 0 }; pool_get (socket_main.registration_pool, rp); - memset (rp, 0, sizeof (*rp)); + clib_memset (rp, 0, sizeof (*rp)); template.read_function = vl_socket_read_ready; template.write_function = vl_socket_write_ready; @@ -506,7 +506,7 @@ vl_sock_api_send_fd_msg (int socket_fd, int fds[], int n_fds) mh.msg_iov = iov; mh.msg_iovlen = 1; - memset (&ctl, 0, sizeof (ctl)); + clib_memset (&ctl, 0, sizeof (ctl)); mh.msg_control = ctl; mh.msg_controllen = sizeof (ctl); cmsg = CMSG_FIRSTHDR (&mh); @@ -609,7 +609,7 @@ vl_api_sock_init_shm_t_handler (vl_api_sock_init_shm_t * mp) * Set up a memfd segment of the requested size wherein the * shmem data structures will be initialized */ - memset (memfd, 0, sizeof (*memfd)); + clib_memset (memfd, 0, sizeof (*memfd)); memfd->ssvm_size = mp->requested_size; memfd->requested_va = 0ULL; memfd->i_am_master = 1; @@ -624,7 +624,7 @@ vl_api_sock_init_shm_t_handler (vl_api_sock_init_shm_t * mp) /* * Create a plausible svm_region in the memfd backed segment */ - memset (a, 0, sizeof (*a)); + clib_memset (a, 0, sizeof (*a)); a->baseva = memfd->sh->ssvm_va + MMAP_PAGESIZE; a->size = memfd->ssvm_size - MMAP_PAGESIZE; /* $$$$ might want a different config parameter */ @@ -729,7 +729,7 @@ vl_sock_api_init (vlib_main_t * vm) return error; pool_get (sm->registration_pool, rp); - memset (rp, 0, sizeof (*rp)); + clib_memset (rp, 0, sizeof (*rp)); rp->registration_type = REGISTRATION_TYPE_SOCKET_LISTEN; |