summaryrefslogtreecommitdiffstats
path: root/src/vnet/util
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/vnet/util
parentb9a4c445c1d4e9cdab476a8e1fb8a46ff0fc6080 (diff)
c11 safe string handling support
Change-Id: Ied34720ca5a6e6e717eea4e86003e854031b6eab Signed-off-by: Dave Barach <dave@barachs.net>
Diffstat (limited to 'src/vnet/util')
-rw-r--r--src/vnet/util/radix.c14
-rw-r--r--src/vnet/util/throttle.h2
2 files changed, 8 insertions, 8 deletions
diff --git a/src/vnet/util/radix.c b/src/vnet/util/radix.c
index ff0b0f7bf38..82b0343348d 100644
--- a/src/vnet/util/radix.c
+++ b/src/vnet/util/radix.c
@@ -74,7 +74,7 @@ rm_alloc (void)
{
struct radix_mask *rm = clib_mem_alloc(sizeof(struct radix_mask));
- memset(rm, 0, sizeof(*rm));
+ clib_memset(rm, 0, sizeof(*rm));
return (rm);
}
@@ -88,7 +88,7 @@ rm_free (struct radix_mask *rm)
#define R_Malloc(p, t, n) \
{ \
p = (t) clib_mem_alloc((unsigned int)(n)); \
- memset(p, 0, n); \
+ clib_memset(p, 0, n); \
}
#define Free(p) clib_mem_free((p))
#define log(a,b, c...)
@@ -518,7 +518,7 @@ rn_addmask(
return mask_rnhead->rnh_nodes;
}
if (m0 < last_zeroed)
- memset(addmask_key + m0, 0, last_zeroed - m0);
+ clib_memset(addmask_key + m0, 0, last_zeroed - m0);
*addmask_key = last_zeroed = mlen;
x = rn_search(addmask_key, rn_masktop);
if (memcmp(addmask_key, x->rn_key, mlen) != 0)
@@ -528,7 +528,7 @@ rn_addmask(
R_Malloc(x, struct radix_node *, max_keylen + 2 * sizeof (*x));
if ((saved_x = x) == NULL)
return NULL;
- memset(x, 0, max_keylen + 2 * sizeof (*x));
+ clib_memset(x, 0, max_keylen + 2 * sizeof (*x));
cp = netmask = (void *)(x + 2);
memmove(x + 2, addmask_key, mlen);
x = rn_insert(cp, mask_rnhead, &maskduplicated, x);
@@ -586,7 +586,7 @@ rn_new_radix_mask(
log(LOG_ERR, "Mask for route not entered\n");
return NULL;
}
- memset(m, 0, sizeof(*m));
+ clib_memset(m, 0, sizeof(*m));
m->rm_b = tt->rn_b;
m->rm_flags = tt->rn_flags;
if (tt->rn_flags & RNF_NORMAL)
@@ -1063,7 +1063,7 @@ rn_inithead0(struct radix_node_head *rnh, int off)
struct radix_node *tt;
struct radix_node *ttt;
- memset(rnh, 0, sizeof(*rnh));
+ clib_memset(rnh, 0, sizeof(*rnh));
t = rn_newpair(rn_zeros, off, rnh->rnh_nodes);
ttt = rnh->rnh_nodes + 2;
t->rn_r = ttt;
@@ -1090,7 +1090,7 @@ rn_module_init (vlib_main_t * vm)
if (rn_zeros == NULL)
return (clib_error_return (0, "RN Zeros..."));
- memset(rn_zeros, 0, 3 * max_keylen);
+ clib_memset(rn_zeros, 0, 3 * max_keylen);
rn_ones = cp = rn_zeros + max_keylen;
addmask_key = cplim = rn_ones + max_keylen;
while (cp < cplim)
diff --git a/src/vnet/util/throttle.h b/src/vnet/util/throttle.h
index 97ebb2597b3..45d437cf471 100644
--- a/src/vnet/util/throttle.h
+++ b/src/vnet/util/throttle.h
@@ -42,7 +42,7 @@ throttle_seed (throttle_t * t, u32 thread_index, f64 time_now)
if (time_now - t->last_seed_change_time[thread_index] > t->time)
{
(void) random_u32 (&t->seeds[thread_index]);
- memset (t->bitmaps[thread_index], 0, THROTTLE_BITS / BITS (u8));
+ clib_memset (t->bitmaps[thread_index], 0, THROTTLE_BITS / BITS (u8));
t->last_seed_change_time[thread_index] = time_now;
}