summaryrefslogtreecommitdiffstats
path: root/src/vnet/classify
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/classify
parentb9a4c445c1d4e9cdab476a8e1fb8a46ff0fc6080 (diff)
c11 safe string handling support
Change-Id: Ied34720ca5a6e6e717eea4e86003e854031b6eab Signed-off-by: Dave Barach <dave@barachs.net>
Diffstat (limited to 'src/vnet/classify')
-rw-r--r--src/vnet/classify/classify_api.c6
-rw-r--r--src/vnet/classify/vnet_classify.c22
2 files changed, 14 insertions, 14 deletions
diff --git a/src/vnet/classify/classify_api.c b/src/vnet/classify/classify_api.c
index 6397b10fbd6..08defd4ecdd 100644
--- a/src/vnet/classify/classify_api.c
+++ b/src/vnet/classify/classify_api.c
@@ -213,7 +213,7 @@ send_policer_classify_details (u32 sw_if_index,
vl_api_policer_classify_details_t *mp;
mp = vl_msg_api_alloc (sizeof (*mp));
- memset (mp, 0, sizeof (*mp));
+ clib_memset (mp, 0, sizeof (*mp));
mp->_vl_msg_id = ntohs (VL_API_POLICER_CLASSIFY_DETAILS);
mp->context = context;
mp->sw_if_index = htonl (sw_if_index);
@@ -395,7 +395,7 @@ send_classify_session_details (vl_api_registration_t * reg,
vl_api_classify_session_details_t *rmp;
rmp = vl_msg_api_alloc (sizeof (*rmp));
- memset (rmp, 0, sizeof (*rmp));
+ clib_memset (rmp, 0, sizeof (*rmp));
rmp->_vl_msg_id = ntohs (VL_API_CLASSIFY_SESSION_DETAILS);
rmp->context = context;
rmp->table_id = ntohl (table_id);
@@ -489,7 +489,7 @@ send_flow_classify_details (u32 sw_if_index,
vl_api_flow_classify_details_t *mp;
mp = vl_msg_api_alloc (sizeof (*mp));
- memset (mp, 0, sizeof (*mp));
+ clib_memset (mp, 0, sizeof (*mp));
mp->_vl_msg_id = ntohs (VL_API_FLOW_CLASSIFY_DETAILS);
mp->context = context;
mp->sw_if_index = htonl (sw_if_index);
diff --git a/src/vnet/classify/vnet_classify.c b/src/vnet/classify/vnet_classify.c
index 52cabbc7f42..36f967a38ac 100644
--- a/src/vnet/classify/vnet_classify.c
+++ b/src/vnet/classify/vnet_classify.c
@@ -128,7 +128,7 @@ vnet_classify_new_table (vnet_classify_main_t * cm,
nbuckets = 1 << (max_log2 (nbuckets));
pool_get_aligned (cm->tables, t, CLIB_CACHE_LINE_BYTES);
- memset (t, 0, sizeof (*t));
+ clib_memset (t, 0, sizeof (*t));
vec_validate_aligned (t->mask, match_n_vectors - 1, sizeof (u32x4));
clib_memcpy (t->mask, mask, match_n_vectors * sizeof (u32x4));
@@ -211,7 +211,7 @@ vnet_classify_entry_alloc (vnet_classify_table_t * t, u32 log2_pages)
initialize:
ASSERT (rv);
- memset (rv, 0xff, required_length);
+ clib_memset (rv, 0xff, required_length);
return rv;
}
@@ -536,8 +536,8 @@ vnet_classify_add_del (vnet_classify_table_t * t,
(v->key, add_v->key, t->match_n_vectors * sizeof (u32x4)))
{
vnet_classify_entry_release_resource (v);
- memset (v, 0xff, sizeof (vnet_classify_entry_t) +
- t->match_n_vectors * sizeof (u32x4));
+ clib_memset (v, 0xff, sizeof (vnet_classify_entry_t) +
+ t->match_n_vectors * sizeof (u32x4));
v->flags |= VNET_CLASSIFY_ENTRY_FREE;
CLIB_MEMORY_BARRIER ();
@@ -845,7 +845,7 @@ unformat_tcp_mask (unformat_input_t * input, va_list * args)
tcp = (tcp_header_t *) mask;
-#define _(a) if (a) memset (&tcp->a, 0xff, sizeof (tcp->a));
+#define _(a) if (a) clib_memset (&tcp->a, 0xff, sizeof (tcp->a));
foreach_tcp_proto_field;
#undef _
@@ -886,7 +886,7 @@ unformat_udp_mask (unformat_input_t * input, va_list * args)
udp = (udp_header_t *) mask;
-#define _(a) if (a) memset (&udp->a, 0xff, sizeof (udp->a));
+#define _(a) if (a) clib_memset (&udp->a, 0xff, sizeof (udp->a));
foreach_udp_proto_field;
#undef _
@@ -981,7 +981,7 @@ unformat_ip4_mask (unformat_input_t * input, va_list * args)
ip = (ip4_header_t *) mask;
-#define _(a) if (a) memset (&ip->a, 0xff, sizeof (ip->a));
+#define _(a) if (a) clib_memset (&ip->a, 0xff, sizeof (ip->a));
foreach_ip4_proto_field;
#undef _
@@ -1053,7 +1053,7 @@ unformat_ip6_mask (unformat_input_t * input, va_list * args)
ip = (ip6_header_t *) mask;
-#define _(a) if (a) memset (&ip->a, 0xff, sizeof (ip->a));
+#define _(a) if (a) clib_memset (&ip->a, 0xff, sizeof (ip->a));
foreach_ip6_proto_field;
#undef _
@@ -1149,10 +1149,10 @@ unformat_l2_mask (unformat_input_t * input, va_list * args)
vec_validate (mask, len - 1);
if (dst)
- memset (mask, 0xff, 6);
+ clib_memset (mask, 0xff, 6);
if (src)
- memset (mask + 6, 0xff, 6);
+ clib_memset (mask + 6, 0xff, 6);
if (tag2 || dot1ad)
{
@@ -2501,7 +2501,7 @@ test_classify_churn (test_classify_main_t * tm)
data = (classify_data_or_mask_t *) dp;
/* Mask on src address */
- memset (&mask->ip.src_address, 0xff, 4);
+ clib_memset (&mask->ip.src_address, 0xff, 4);
tmp = clib_host_to_net_u32 (tm->src.as_u32);