summaryrefslogtreecommitdiffstats
path: root/src/vnet/lisp-gpe
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/lisp-gpe
parentb9a4c445c1d4e9cdab476a8e1fb8a46ff0fc6080 (diff)
c11 safe string handling support
Change-Id: Ied34720ca5a6e6e717eea4e86003e854031b6eab Signed-off-by: Dave Barach <dave@barachs.net>
Diffstat (limited to 'src/vnet/lisp-gpe')
-rw-r--r--src/vnet/lisp-gpe/lisp_gpe.c12
-rw-r--r--src/vnet/lisp-gpe/lisp_gpe_adjacency.c6
-rw-r--r--src/vnet/lisp-gpe/lisp_gpe_api.c12
-rw-r--r--src/vnet/lisp-gpe/lisp_gpe_fwd_entry.c18
-rw-r--r--src/vnet/lisp-gpe/lisp_gpe_sub_interface.c6
-rw-r--r--src/vnet/lisp-gpe/lisp_gpe_tenant.c2
-rw-r--r--src/vnet/lisp-gpe/lisp_gpe_tunnel.c4
7 files changed, 30 insertions, 30 deletions
diff --git a/src/vnet/lisp-gpe/lisp_gpe.c b/src/vnet/lisp-gpe/lisp_gpe.c
index 66304ae344a..367dbae4159 100644
--- a/src/vnet/lisp-gpe/lisp_gpe.c
+++ b/src/vnet/lisp-gpe/lisp_gpe.c
@@ -47,8 +47,8 @@ lisp_gpe_add_del_fwd_entry_command_fn (vlib_main_t * vm,
locator_pair_t pair, *pairs = 0;
int rv;
- memset (leid, 0, sizeof (*leid));
- memset (reid, 0, sizeof (*reid));
+ clib_memset (leid, 0, sizeof (*leid));
+ clib_memset (reid, 0, sizeof (*reid));
/* Get a line of input. */
if (!unformat_user (input, unformat_line_input, line_input))
@@ -145,7 +145,7 @@ lisp_gpe_add_del_fwd_entry_command_fn (vlib_main_t * vm,
/* add fwd entry */
vnet_lisp_gpe_add_del_fwd_entry_args_t _a, *a = &_a;
- memset (a, 0, sizeof (a[0]));
+ clib_memset (a, 0, sizeof (a[0]));
a->is_add = is_add;
a->is_negative = is_negative;
@@ -503,7 +503,7 @@ gpe_native_forward_command_fn (vlib_main_t * vm, unformat_input_t * input,
if (!unformat_user (input, unformat_line_input, line_input))
return 0;
- memset (&rpath, 0, sizeof (rpath));
+ clib_memset (&rpath, 0, sizeof (rpath));
while (unformat_check_input (line_input) != UNFORMAT_END_OF_INPUT)
{
@@ -621,7 +621,7 @@ lisp_gpe_init (vlib_main_t * vm)
lgm->lisp_stats_index_by_key =
hash_create_mem (0, sizeof (lisp_stats_key_t), sizeof (uword));
- memset (&lgm->counters, 0, sizeof (lgm->counters));
+ clib_memset (&lgm->counters, 0, sizeof (lgm->counters));
lgm->counters.name = "LISP counters";
return 0;
@@ -646,7 +646,7 @@ lisp_gpe_test_send_nsh_packet (u8 * file_name)
if (!file_name)
return clib_error_create ("no pcap file specified!");
- memset (&pm, 0, sizeof (pm));
+ clib_memset (&pm, 0, sizeof (pm));
pm.file_name = (char *) file_name;
error = pcap_read (&pm);
if (error)
diff --git a/src/vnet/lisp-gpe/lisp_gpe_adjacency.c b/src/vnet/lisp-gpe/lisp_gpe_adjacency.c
index 7464af3d441..6f85dc4a761 100644
--- a/src/vnet/lisp-gpe/lisp_gpe_adjacency.c
+++ b/src/vnet/lisp-gpe/lisp_gpe_adjacency.c
@@ -115,7 +115,7 @@ ip46_address_to_ip_address (const ip46_address_t * a, ip_address_t * b)
{
if (ip46_address_is_ip4 (a))
{
- memset (b, 0, sizeof (*b));
+ clib_memset (b, 0, sizeof (*b));
ip_address_set (b, &a->ip4, IP4);
}
else
@@ -293,7 +293,7 @@ lisp_gpe_increment_stats_counters (lisp_cp_main_t * lcm, ip_adjacency_t * adj,
return;
lisp_stats_key_t key;
- memset (&key, 0, sizeof (key));
+ clib_memset (&key, 0, sizeof (key));
key.fwd_entry_index = feip[0];
key.tunnel_index = ladj->tunnel_index;
@@ -395,7 +395,7 @@ lisp_gpe_adjacency_find_or_create_and_lock (const locator_pair_t * pair,
{
pool_get (lisp_adj_pool, ladj);
- memset (ladj, 0, sizeof (*ladj));
+ clib_memset (ladj, 0, sizeof (*ladj));
lai = (ladj - lisp_adj_pool);
ip_address_copy (&ladj->remote_rloc, &pair->rmt_loc);
diff --git a/src/vnet/lisp-gpe/lisp_gpe_api.c b/src/vnet/lisp-gpe/lisp_gpe_api.c
index 97409f597ca..86328fc2cf8 100644
--- a/src/vnet/lisp-gpe/lisp_gpe_api.c
+++ b/src/vnet/lisp-gpe/lisp_gpe_api.c
@@ -74,7 +74,7 @@ unformat_gpe_loc_pairs (void *locs, u32 rloc_num)
{
/* local locator */
r = &((vl_api_gpe_locator_t *) locs)[i];
- memset (&pair, 0, sizeof (pair));
+ clib_memset (&pair, 0, sizeof (pair));
ip_address_set (&pair.lcl_loc, &r->addr, r->is_ip4 ? IP4 : IP6);
pair.weight = r->weight;
@@ -174,7 +174,7 @@ static void
vec_foreach (path, lfe->paths)
{
rmp = vl_msg_api_alloc (sizeof (*rmp));
- memset (rmp, 0, sizeof (*rmp));
+ clib_memset (rmp, 0, sizeof (*rmp));
const lisp_gpe_tunnel_t *lgt;
rmp->_vl_msg_id =
@@ -200,7 +200,7 @@ gpe_fwd_entries_copy (vl_api_gpe_fwd_entry_t * dst,
vec_foreach (e, src)
{
- memset (&dst[i], 0, sizeof (*dst));
+ clib_memset (&dst[i], 0, sizeof (*dst));
dst[i].dp_table = e->dp_table;
dst[i].fwd_entry_index = e->fwd_entry_index;
dst[i].vni = e->vni;
@@ -332,7 +332,7 @@ vl_api_gpe_add_del_fwd_entry_t_handler (vl_api_gpe_add_del_fwd_entry_t * mp)
int rv = 0;
gpe_add_del_fwd_entry_t_net_to_host (mp);
- memset (a, 0, sizeof (a[0]));
+ clib_memset (a, 0, sizeof (a[0]));
rv = unformat_lisp_eid_api (&a->rmt_eid, mp->vni, mp->eid_type,
mp->rmt_eid, mp->rmt_len);
@@ -447,7 +447,7 @@ static void
vnet_gpe_native_fwd_rpath_args_t _a, *a = &_a;
int rv = 0;
- memset (a, 0, sizeof (a[0]));
+ clib_memset (a, 0, sizeof (a[0]));
if (mp->is_ip4)
clib_memcpy (&a->rpath.frp_addr.ip4, mp->nh_addr, sizeof (ip4_address_t));
@@ -483,7 +483,7 @@ gpe_native_fwd_rpaths_copy (vl_api_gpe_native_fwd_rpath_t * dst,
vec_foreach (e, src)
{
- memset (&dst[i], 0, sizeof (*dst));
+ clib_memset (&dst[i], 0, sizeof (*dst));
table = fib_table_get (e->frp_fib_index, dpo_proto_to_fib (e->frp_proto));
dst[i].fib_index = table->ft_table_id;
dst[i].nh_sw_if_index = e->frp_sw_if_index;
diff --git a/src/vnet/lisp-gpe/lisp_gpe_fwd_entry.c b/src/vnet/lisp-gpe/lisp_gpe_fwd_entry.c
index f810ae5fec4..2d6cd013941 100644
--- a/src/vnet/lisp-gpe/lisp_gpe_fwd_entry.c
+++ b/src/vnet/lisp-gpe/lisp_gpe_fwd_entry.c
@@ -409,7 +409,7 @@ find_fwd_entry (lisp_gpe_main_t * lgm,
{
uword *p;
- memset (key, 0, sizeof (*key));
+ clib_memset (key, 0, sizeof (*key));
if (GID_ADDR_IP_PREFIX == gid_address_type (&a->rmt_eid))
{
@@ -486,7 +486,7 @@ vnet_lisp_gpe_add_fwd_counters (vnet_lisp_gpe_add_del_fwd_entry_args_t * a,
if (LISP_GPE_FWD_ENTRY_TYPE_NORMAL != lfe->type)
return;
- memset (&key, 0, sizeof (key));
+ clib_memset (&key, 0, sizeof (key));
key.fwd_entry_index = fwd_entry_index;
vec_foreach (path, lfe->paths)
@@ -531,7 +531,7 @@ add_ip_fwd_entry (lisp_gpe_main_t * lgm,
return VNET_API_ERROR_INVALID_VALUE;
pool_get (lgm->lisp_fwd_entry_pool, lfe);
- memset (lfe, 0, sizeof (*lfe));
+ clib_memset (lfe, 0, sizeof (*lfe));
lfe->key = clib_mem_alloc (sizeof (key));
memcpy (lfe->key, &key, sizeof (key));
@@ -848,7 +848,7 @@ add_l2_fwd_entry (lisp_gpe_main_t * lgm,
return VNET_API_ERROR_INVALID_VALUE;
pool_get (lgm->lisp_fwd_entry_pool, lfe);
- memset (lfe, 0, sizeof (*lfe));
+ clib_memset (lfe, 0, sizeof (*lfe));
lfe->key = clib_mem_alloc (sizeof (key));
memcpy (lfe->key, &key, sizeof (key));
@@ -916,7 +916,7 @@ lisp_nsh_fib_lookup (lisp_gpe_main_t * lgm, u32 spi_si_net_order)
int rv;
BVT (clib_bihash_kv) kv, value;
- memset (&kv, 0, sizeof (kv));
+ clib_memset (&kv, 0, sizeof (kv));
kv.key[0] = spi_si_net_order;
rv = BV (clib_bihash_search_inline_2) (&lgm->nsh_fib, &kv, &value);
@@ -951,7 +951,7 @@ lisp_nsh_fib_add_del_entry (u32 spi_si_host_order, u32 lfei, u8 is_add)
BVT (clib_bihash_kv) kv, value;
u32 old_val = ~0;
- memset (&kv, 0, sizeof (kv));
+ clib_memset (&kv, 0, sizeof (kv));
kv.key[0] = clib_host_to_net_u32 (spi_si_host_order);
kv.value = 0ULL;
@@ -1123,7 +1123,7 @@ add_nsh_fwd_entry (lisp_gpe_main_t * lgm,
return VNET_API_ERROR_INVALID_VALUE;
pool_get (lgm->lisp_fwd_entry_pool, lfe);
- memset (lfe, 0, sizeof (*lfe));
+ clib_memset (lfe, 0, sizeof (*lfe));
lfe->key = clib_mem_alloc (sizeof (key));
memcpy (lfe->key, &key, sizeof (key));
@@ -1307,7 +1307,7 @@ lisp_del_adj_stats (lisp_gpe_main_t * lgm, u32 fwd_entry_index, u32 ti)
uword *p;
u8 *s;
- memset (&key, 0, sizeof (key));
+ clib_memset (&key, 0, sizeof (key));
key.fwd_entry_index = fwd_entry_index;
key.tunnel_index = ti;
@@ -1543,7 +1543,7 @@ vnet_lisp_gpe_fwd_entries_get_by_vni (u32 vni)
({
if (lfe->key->vni == vni)
{
- memset (&e, 0, sizeof (e));
+ clib_memset (&e, 0, sizeof (e));
e.dp_table = lfe->eid_table_id;
e.vni = lfe->key->vni;
if (lfe->type == LISP_GPE_FWD_ENTRY_TYPE_NEGATIVE)
diff --git a/src/vnet/lisp-gpe/lisp_gpe_sub_interface.c b/src/vnet/lisp-gpe/lisp_gpe_sub_interface.c
index 3f56dbea08d..1ccd5817d7f 100644
--- a/src/vnet/lisp-gpe/lisp_gpe_sub_interface.c
+++ b/src/vnet/lisp-gpe/lisp_gpe_sub_interface.c
@@ -51,7 +51,7 @@ lisp_gpe_sub_interface_db_find (const ip_address_t * lrloc, u32 vni)
lisp_gpe_sub_interface_key_t key;
- memset (&key, 0, sizeof (key));
+ clib_memset (&key, 0, sizeof (key));
ip_address_copy (&key.local_rloc, lrloc);
key.vni = vni;
p = hash_get_mem (lisp_gpe_sub_interfaces, &key);
@@ -151,9 +151,9 @@ lisp_gpe_sub_interface_find_or_create_and_lock (const ip_address_t * lrloc,
return (INDEX_INVALID);
pool_get (lisp_gpe_sub_interface_pool, l3s);
- memset (l3s, 0, sizeof (*l3s));
+ clib_memset (l3s, 0, sizeof (*l3s));
l3s->key = clib_mem_alloc (sizeof (*l3s->key));
- memset (l3s->key, 0, sizeof (*l3s->key));
+ clib_memset (l3s->key, 0, sizeof (*l3s->key));
ip_address_copy (&l3s->key->local_rloc, lrloc);
l3s->key->vni = vni;
diff --git a/src/vnet/lisp-gpe/lisp_gpe_tenant.c b/src/vnet/lisp-gpe/lisp_gpe_tenant.c
index 814b0d316cb..8da1fd40b9d 100644
--- a/src/vnet/lisp-gpe/lisp_gpe_tenant.c
+++ b/src/vnet/lisp-gpe/lisp_gpe_tenant.c
@@ -48,7 +48,7 @@ lisp_gpe_tenant_find_or_create_i (u32 vni)
if (NULL == lt)
{
pool_get (lisp_gpe_tenant_pool, lt);
- memset (lt, 0, sizeof (*lt));
+ clib_memset (lt, 0, sizeof (*lt));
lt->lt_vni = vni;
lt->lt_table_id = ~0;
diff --git a/src/vnet/lisp-gpe/lisp_gpe_tunnel.c b/src/vnet/lisp-gpe/lisp_gpe_tunnel.c
index dd6c6fddfd9..e4ad872790c 100644
--- a/src/vnet/lisp-gpe/lisp_gpe_tunnel.c
+++ b/src/vnet/lisp-gpe/lisp_gpe_tunnel.c
@@ -161,10 +161,10 @@ lisp_gpe_tunnel_find_or_create_and_lock (const locator_pair_t * pair,
if (NULL == lgt)
{
pool_get (lisp_gpe_tunnel_pool, lgt);
- memset (lgt, 0, sizeof (*lgt));
+ clib_memset (lgt, 0, sizeof (*lgt));
lgt->key = clib_mem_alloc (sizeof (*lgt->key));
- memset (lgt->key, 0, sizeof (*lgt->key));
+ clib_memset (lgt->key, 0, sizeof (*lgt->key));
lgt->key->rmt = pair->rmt_loc;
lgt->key->lcl = pair->lcl_loc;