aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/memif
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/plugins/memif
parentb9a4c445c1d4e9cdab476a8e1fb8a46ff0fc6080 (diff)
c11 safe string handling support
Change-Id: Ied34720ca5a6e6e717eea4e86003e854031b6eab Signed-off-by: Dave Barach <dave@barachs.net>
Diffstat (limited to 'src/plugins/memif')
-rw-r--r--src/plugins/memif/memif.c14
-rw-r--r--src/plugins/memif/memif_api.c4
-rw-r--r--src/plugins/memif/node.c2
-rw-r--r--src/plugins/memif/socket.c4
4 files changed, 12 insertions, 12 deletions
diff --git a/src/plugins/memif/memif.c b/src/plugins/memif/memif.c
index e8fb0e94a69..763572c2f0e 100644
--- a/src/plugins/memif/memif.c
+++ b/src/plugins/memif/memif.c
@@ -460,7 +460,7 @@ memif_process (vlib_main_t * vm, vlib_node_runtime_t * rt, vlib_frame_t * f)
clib_error_t *err;
sock = clib_mem_alloc (sizeof (clib_socket_t));
- memset (sock, 0, sizeof (clib_socket_t));
+ clib_memset (sock, 0, sizeof (clib_socket_t));
while (1)
{
@@ -511,7 +511,7 @@ memif_process (vlib_main_t * vm, vlib_node_runtime_t * rt, vlib_frame_t * f)
if (mif->flags & MEMIF_IF_FLAG_IS_SLAVE)
{
- memset (sock, 0, sizeof(clib_socket_t));
+ clib_memset (sock, 0, sizeof(clib_socket_t));
sock->config = (char *) msf->filename;
sock->flags = CLIB_SOCKET_F_IS_CLIENT| CLIB_SOCKET_F_SEQPACKET;
@@ -576,7 +576,7 @@ memif_add_socket_file (u32 sock_id, u8 * socket_filename)
}
pool_get (mm->socket_files, msf);
- memset (msf, 0, sizeof (memif_socket_file_t));
+ clib_memset (msf, 0, sizeof (memif_socket_file_t));
msf->filename = socket_filename;
msf->socket_id = sock_id;
@@ -756,7 +756,7 @@ memif_delete_if (vlib_main_t * vm, memif_if_t * mif)
}
}
- memset (mif, 0, sizeof (*mif));
+ clib_memset (mif, 0, sizeof (*mif));
pool_put (mm->interfaces, mif);
if (pool_elts (mm->interfaces) == 0)
@@ -875,7 +875,7 @@ memif_create_if (vlib_main_t * vm, memif_create_if_args_t * args)
}
pool_get (mm->interfaces, mif);
- memset (mif, 0, sizeof (*mif));
+ clib_memset (mif, 0, sizeof (*mif));
mif->dev_instance = mif - mm->interfaces;
mif->socket_file_index = msf - mm->socket_files;
mif->id = args->id;
@@ -944,7 +944,7 @@ memif_create_if (vlib_main_t * vm, memif_create_if_args_t * args)
ASSERT (msf->sock == 0);
msf->sock = s;
- memset (s, 0, sizeof (clib_socket_t));
+ clib_memset (s, 0, sizeof (clib_socket_t));
s->config = (char *) msf->filename;
s->flags = CLIB_SOCKET_F_IS_SERVER |
CLIB_SOCKET_F_ALLOW_GROUP_WRITE |
@@ -1019,7 +1019,7 @@ memif_init (vlib_main_t * vm)
{
memif_main_t *mm = &memif_main;
- memset (mm, 0, sizeof (memif_main_t));
+ clib_memset (mm, 0, sizeof (memif_main_t));
mm->log_class = vlib_log_register_class ("memif_plugin", 0);
memif_log_debug (0, "initialized");
diff --git a/src/plugins/memif/memif_api.c b/src/plugins/memif/memif_api.c
index a4137e48006..77a87cc709d 100644
--- a/src/plugins/memif/memif_api.c
+++ b/src/plugins/memif/memif_api.c
@@ -274,7 +274,7 @@ send_memif_details (vl_api_registration_t * reg,
hwif = vnet_get_sup_hw_interface (vnm, swif->sw_if_index);
mp = vl_msg_api_alloc (sizeof (*mp));
- memset (mp, 0, sizeof (*mp));
+ clib_memset (mp, 0, sizeof (*mp));
mp->_vl_msg_id = htons (VL_API_MEMIF_DETAILS + mm->msg_id_base);
mp->context = context;
@@ -347,7 +347,7 @@ send_memif_socket_filename_details (vl_api_registration_t * reg,
memif_main_t *mm = &memif_main;
mp = vl_msg_api_alloc (sizeof (*mp));
- memset (mp, 0, sizeof (*mp));
+ clib_memset (mp, 0, sizeof (*mp));
mp->_vl_msg_id = htons (VL_API_MEMIF_SOCKET_FILENAME_DETAILS
+ mm->msg_id_base);
diff --git a/src/plugins/memif/node.c b/src/plugins/memif/node.c
index 53a355361a6..997ac8fcbad 100644
--- a/src/plugins/memif/node.c
+++ b/src/plugins/memif/node.c
@@ -750,7 +750,7 @@ refill:
goto done;
memif_desc_t *dt = &ptd->desc_template;
- memset (dt, 0, sizeof (memif_desc_t));
+ clib_memset (dt, 0, sizeof (memif_desc_t));
dt->length = buffer_length;
n_alloc = vlib_buffer_alloc_to_ring (vm, mq->buffers, head & mask,
diff --git a/src/plugins/memif/socket.c b/src/plugins/memif/socket.c
index ac48ba88da5..fac8cd4838e 100644
--- a/src/plugins/memif/socket.c
+++ b/src/plugins/memif/socket.c
@@ -356,7 +356,7 @@ memif_msg_receive_add_ring (memif_if_t * mif, memif_msg_t * msg, int fd)
}
// clear previous cache data if interface reconncected
- memset (mq, 0, sizeof (memif_queue_t));
+ clib_memset (mq, 0, sizeof (memif_queue_t));
mq->int_fd = fd;
mq->int_clib_file_index = ~0;
mq->log2_ring_size = ar->log2_ring_size;
@@ -656,7 +656,7 @@ memif_conn_fd_accept_ready (clib_file_t * uf)
clib_socket_t *client;
client = clib_mem_alloc (sizeof (clib_socket_t));
- memset (client, 0, sizeof (clib_socket_t));
+ clib_memset (client, 0, sizeof (clib_socket_t));
err = clib_socket_accept (msf->sock, client);
if (err)
goto error;