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/vnet/bier | |
parent | b9a4c445c1d4e9cdab476a8e1fb8a46ff0fc6080 (diff) |
c11 safe string handling support
Change-Id: Ied34720ca5a6e6e717eea4e86003e854031b6eab
Signed-off-by: Dave Barach <dave@barachs.net>
Diffstat (limited to 'src/vnet/bier')
-rw-r--r-- | src/vnet/bier/bier_api.c | 10 | ||||
-rw-r--r-- | src/vnet/bier/bier_bift_table.c | 2 | ||||
-rw-r--r-- | src/vnet/bier/bier_disp_table.c | 2 | ||||
-rw-r--r-- | src/vnet/bier/bier_fmask.c | 8 | ||||
-rw-r--r-- | src/vnet/bier/bier_fmask_db.c | 2 | ||||
-rw-r--r-- | src/vnet/bier/bier_hdr_inlines.h | 2 | ||||
-rw-r--r-- | src/vnet/bier/bier_test.c | 2 |
7 files changed, 14 insertions, 14 deletions
diff --git a/src/vnet/bier/bier_api.c b/src/vnet/bier/bier_api.c index 2e8fc626baa..b4bde3a97eb 100644 --- a/src/vnet/bier/bier_api.c +++ b/src/vnet/bier/bier_api.c @@ -123,7 +123,7 @@ send_bier_table_details (vl_api_registration_t * reg, mp = vl_msg_api_alloc(sizeof(*mp)); if (!mp) return; - memset(mp, 0, sizeof(*mp)); + clib_memset(mp, 0, sizeof(*mp)); mp->_vl_msg_id = ntohs(VL_API_BIER_TABLE_DETAILS); mp->context = context; @@ -254,7 +254,7 @@ send_bier_route_details (const bier_table_t *bt, if (!mp) return; - memset(mp, 0, m_size); + clib_memset(mp, 0, m_size); mp->_vl_msg_id = ntohs(VL_API_BIER_ROUTE_DETAILS); mp->context = ctx->context; @@ -373,7 +373,7 @@ send_bier_imp_details (vl_api_registration_t * reg, mp = vl_msg_api_alloc(sizeof(*mp) + n_bytes); if (!mp) return; - memset(mp, 0, sizeof(*mp)+n_bytes); + clib_memset(mp, 0, sizeof(*mp)+n_bytes); mp->_vl_msg_id = ntohs(VL_API_BIER_IMP_DETAILS); mp->context = context; @@ -440,7 +440,7 @@ send_bier_disp_table_details (vl_api_registration_t * reg, mp = vl_msg_api_alloc(sizeof(*mp)); if (!mp) return; - memset(mp, 0, sizeof(*mp)); + clib_memset(mp, 0, sizeof(*mp)); mp->_vl_msg_id = ntohs(VL_API_BIER_DISP_TABLE_DETAILS); mp->context = context; @@ -616,7 +616,7 @@ send_bier_disp_entry_details (const bier_disp_table_t *bdt, if (!mp) return; - memset(mp, 0, m_size); + clib_memset(mp, 0, m_size); mp->_vl_msg_id = ntohs(VL_API_BIER_DISP_ENTRY_DETAILS); mp->context = ctx->context; diff --git a/src/vnet/bier/bier_bift_table.c b/src/vnet/bier/bier_bift_table.c index cf0d552f192..76e29dc9e52 100644 --- a/src/vnet/bier/bier_bift_table.c +++ b/src/vnet/bier/bier_bift_table.c @@ -54,7 +54,7 @@ bier_bift_table_entry_add (bier_bift_id_t id, */ bier_bift_table = clib_mem_alloc_aligned(sizeof(*bier_bift_table), CLIB_CACHE_LINE_BYTES); - memset(bier_bift_table, 0, sizeof(*bier_bift_table)); + clib_memset(bier_bift_table, 0, sizeof(*bier_bift_table)); for (ii = 0; ii < BIER_BIFT_N_ENTRIES; ii++) { diff --git a/src/vnet/bier/bier_disp_table.c b/src/vnet/bier/bier_disp_table.c index 68edb088400..cf9f0538df7 100644 --- a/src/vnet/bier/bier_disp_table.c +++ b/src/vnet/bier/bier_disp_table.c @@ -75,7 +75,7 @@ bier_disp_table_add_or_lock (u32 table_id) /** * Set the result for each entry in the DB to be invalid */ - memset(bdt->bdt_db, 0xff, sizeof(bdt->bdt_db)); + clib_memset(bdt->bdt_db, 0xff, sizeof(bdt->bdt_db)); } else { diff --git a/src/vnet/bier/bier_fmask.c b/src/vnet/bier/bier_fmask.c index 3370d5a88e8..1ca8a2e1df9 100644 --- a/src/vnet/bier/bier_fmask.c +++ b/src/vnet/bier/bier_fmask.c @@ -54,7 +54,7 @@ bier_fmask_bits_init (bier_fmask_bits_t *bits, { bits->bfmb_refs = clib_mem_alloc(sizeof(bits->bfmb_refs[0]) * bier_hdr_len_id_to_num_bits(hlid)); - memset(bits->bfmb_refs, + clib_memset(bits->bfmb_refs, 0, (sizeof(bits->bfmb_refs[0]) * bier_hdr_len_id_to_num_bits(hlid))); @@ -70,7 +70,7 @@ bier_fmask_bits_init (bier_fmask_bits_t *bits, sizeof(bits->bfmb_input_reset_string.bbs_buckets[0]) * bier_hdr_len_id_to_num_buckets(hlid), CLIB_CACHE_LINE_BYTES); - memset(bits->bfmb_input_reset_string.bbs_buckets, + clib_memset(bits->bfmb_input_reset_string.bbs_buckets, 0, sizeof(bits->bfmb_input_reset_string.bbs_buckets[0]) * bier_hdr_len_id_to_num_buckets(hlid)); @@ -171,7 +171,7 @@ bier_fmask_init (bier_fmask_t *bfm, fib_route_path_t *rpaths; mpls_label_t olabel; - memset(bfm, 0, sizeof(*bfm)); + clib_memset(bfm, 0, sizeof(*bfm)); bfm->bfm_id = clib_mem_alloc(sizeof(*bfm->bfm_id)); @@ -411,7 +411,7 @@ bier_fmask_encode (index_t bfmi, bfm = bier_fmask_get(bfmi); *btid = *bier_table_get_id(bfm->bfm_id->bfmi_bti); - memset(rpath, 0, sizeof(*rpath)); + clib_memset(rpath, 0, sizeof(*rpath)); rpath->rpath.frp_sw_if_index = ~0; diff --git a/src/vnet/bier/bier_fmask_db.c b/src/vnet/bier/bier_fmask_db.c index 59e2973b589..0ee1e5d6bf8 100644 --- a/src/vnet/bier/bier_fmask_db.c +++ b/src/vnet/bier/bier_fmask_db.c @@ -60,7 +60,7 @@ bier_fmask_db_mk_key (index_t bti, * Depending on what the ID is there may be padding. * This key will be memcmp'd in the mhash, so make sure it's all 0 */ - memset(key, 0, sizeof(*key)); + clib_memset(key, 0, sizeof(*key)); /* * Pick the attributes from the path that make the FMask unique diff --git a/src/vnet/bier/bier_hdr_inlines.h b/src/vnet/bier/bier_hdr_inlines.h index d58926e97ef..81e196d4c0b 100644 --- a/src/vnet/bier/bier_hdr_inlines.h +++ b/src/vnet/bier/bier_hdr_inlines.h @@ -175,7 +175,7 @@ bier_hdr_get_proto_id (const bier_hdr_t *bier_hdr) static inline void bier_hdr_clear (bier_hdr_t *bier_hdr) { - memset(&bier_hdr->bh_bit_string, 0, + clib_memset(&bier_hdr->bh_bit_string, 0, bier_hdr_len_id_to_num_buckets( bier_hdr_get_len_id(bier_hdr))); } diff --git a/src/vnet/bier/bier_test.c b/src/vnet/bier/bier_test.c index 06160f60aab..d15ee595b64 100644 --- a/src/vnet/bier/bier_test.c +++ b/src/vnet/bier/bier_test.c @@ -742,7 +742,7 @@ bier_test_mpls_imp (void) */ bier_bit_string_t bbs_256; u8 buckets[BIER_HDR_BUCKETS_256]; - memset(buckets, 0x5, BIER_HDR_BUCKETS_256); + clib_memset(buckets, 0x5, BIER_HDR_BUCKETS_256); res = 0; bier_bit_string_init(&bbs_256, BIER_HDR_LEN_256, buckets); |