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/l2 | |
parent | b9a4c445c1d4e9cdab476a8e1fb8a46ff0fc6080 (diff) |
c11 safe string handling support
Change-Id: Ied34720ca5a6e6e717eea4e86003e854031b6eab
Signed-off-by: Dave Barach <dave@barachs.net>
Diffstat (limited to 'src/vnet/l2')
-rw-r--r-- | src/vnet/l2/l2_api.c | 8 | ||||
-rw-r--r-- | src/vnet/l2/l2_bd.c | 2 | ||||
-rw-r--r-- | src/vnet/l2/l2_fib.c | 2 | ||||
-rw-r--r-- | src/vnet/l2/l2_input.c | 2 | ||||
-rw-r--r-- | src/vnet/l2/l2_rw.c | 4 | ||||
-rw-r--r-- | src/vnet/l2/l2_xcrw.c | 6 |
6 files changed, 12 insertions, 12 deletions
diff --git a/src/vnet/l2/l2_api.c b/src/vnet/l2/l2_api.c index eb04459f234..377880c3e64 100644 --- a/src/vnet/l2/l2_api.c +++ b/src/vnet/l2/l2_api.c @@ -80,7 +80,7 @@ send_l2_xconnect_details (vl_api_registration_t * reg, u32 context, vl_api_l2_xconnect_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_L2_XCONNECT_DETAILS); mp->context = context; mp->rx_sw_if_index = htonl (rx_sw_if_index); @@ -135,7 +135,7 @@ send_l2fib_table_entry (vpe_api_main_t * am, vl_api_l2_fib_table_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_L2_FIB_TABLE_DETAILS); mp->bd_id = @@ -456,7 +456,7 @@ send_bridge_domain_details (l2input_main_t * l2im, mp = vl_msg_api_alloc (sizeof (*mp) + (n_sw_ifs * sizeof (vl_api_bridge_domain_sw_if_t))); - memset (mp, 0, sizeof (*mp)); + clib_memset (mp, 0, sizeof (*mp)); mp->_vl_msg_id = ntohs (VL_API_BRIDGE_DOMAIN_DETAILS); mp->bd_id = ntohl (bd_config->bd_id); mp->flood = bd_feature_flood (bd_config); @@ -781,7 +781,7 @@ send_bd_ip_mac_entry (vpe_api_main_t * am, vl_api_bd_ip_mac_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_BD_IP_MAC_DETAILS); mp->bd_id = ntohl (bd_id); diff --git a/src/vnet/l2/l2_bd.c b/src/vnet/l2/l2_bd.c index 47bdce6af68..59149093b21 100644 --- a/src/vnet/l2/l2_bd.c +++ b/src/vnet/l2/l2_bd.c @@ -1298,7 +1298,7 @@ bd_add_del_command_fn (vlib_main_t * vm, unformat_input_t * input, goto done; } - memset (a, 0, sizeof (*a)); + clib_memset (a, 0, sizeof (*a)); a->is_add = is_add; a->bd_id = bd_id; a->flood = (u8) flood; diff --git a/src/vnet/l2/l2_fib.c b/src/vnet/l2/l2_fib.c index aa325052487..46c041e72a0 100644 --- a/src/vnet/l2/l2_fib.c +++ b/src/vnet/l2/l2_fib.c @@ -1242,7 +1242,7 @@ l2fib_init (vlib_main_t * vm) L2FIB_NUM_BUCKETS, L2FIB_MEMORY_SIZE); /* verify the key constructor is good, since it is endian-sensitive */ - memset (test_mac, 0, sizeof (test_mac)); + clib_memset (test_mac, 0, sizeof (test_mac)); test_mac[0] = 0x11; test_key.raw = 0; test_key.raw = l2fib_make_key ((u8 *) & test_mac, 0x1234); diff --git a/src/vnet/l2/l2_input.c b/src/vnet/l2/l2_input.c index 9727d408088..fbd3b940fae 100644 --- a/src/vnet/l2/l2_input.c +++ b/src/vnet/l2/l2_input.c @@ -649,7 +649,7 @@ set_int_l2_mode (vlib_main_t * vm, vnet_main_t * vnet_main, /* */ /* Clear L2 output config */ out_config = l2output_intf_config (sw_if_index); - memset (out_config, 0, sizeof (l2_output_config_t)); + clib_memset (out_config, 0, sizeof (l2_output_config_t)); /* Make sure any L2-output packet to this interface now in L3 mode is * dropped. This may happen if L2 FIB MAC entry is stale */ diff --git a/src/vnet/l2/l2_rw.c b/src/vnet/l2/l2_rw.c index 0b5e970944d..5b0034ca43e 100644 --- a/src/vnet/l2/l2_rw.c +++ b/src/vnet/l2/l2_rw.c @@ -381,9 +381,9 @@ l2_rw_mod_entry (u32 * index, skip -= e->skip_n_vectors * sizeof (u32x4); e->rewrite_n_vectors = (skip + len - 1) / sizeof (u32x4) + 1; vec_alloc_aligned (e->mask, e->rewrite_n_vectors, sizeof (u32x4)); - memset (e->mask, 0, e->rewrite_n_vectors * sizeof (u32x4)); + clib_memset (e->mask, 0, e->rewrite_n_vectors * sizeof (u32x4)); vec_alloc_aligned (e->value, e->rewrite_n_vectors, sizeof (u32x4)); - memset (e->value, 0, e->rewrite_n_vectors * sizeof (u32x4)); + clib_memset (e->value, 0, e->rewrite_n_vectors * sizeof (u32x4)); clib_memcpy (((u8 *) e->value) + skip, value, len); clib_memcpy (((u8 *) e->mask) + skip, mask, len); diff --git a/src/vnet/l2/l2_xcrw.c b/src/vnet/l2/l2_xcrw.c index 334e8641455..b7ccd81806f 100644 --- a/src/vnet/l2/l2_xcrw.c +++ b/src/vnet/l2/l2_xcrw.c @@ -306,7 +306,7 @@ create_xcrw_interface (vlib_main_t * vm) u32 sw_if_index; /* mac address doesn't really matter */ - memset (address, 0, sizeof (address)); + clib_memset (address, 0, sizeof (address)); address[2] = 0x12; /* can returns error iff phy != 0 */ @@ -352,7 +352,7 @@ vnet_configure_l2_xcrw (vlib_main_t * vm, vnet_main_t * vnm, vec_validate (xcm->adj_by_sw_if_index, t->l2_sw_if_index); a = vec_elt_at_index (xcm->adj_by_sw_if_index, t->l2_sw_if_index); - memset (a, 0, sizeof (*a)); + clib_memset (a, 0, sizeof (*a)); a->rewrite_header.sw_if_index = tx_fib_index; @@ -382,7 +382,7 @@ vnet_configure_l2_xcrw (vlib_main_t * vm, vnet_main_t * vnm, a = vec_elt_at_index (xcm->adj_by_sw_if_index, t->l2_sw_if_index); /* Reset adj to drop traffic */ - memset (a, 0, sizeof (*a)); + clib_memset (a, 0, sizeof (*a)); set_int_l2_mode (vm, vnm, MODE_L3, t->l2_sw_if_index, 0, L2_BD_PORT_TYPE_NORMAL, 0, 0); |