From b7b929931a07fbb27b43d5cd105f366c3e29807e Mon Sep 17 00:00:00 2001 From: Dave Barach Date: Wed, 17 Oct 2018 10:38:51 -0400 Subject: c11 safe string handling support Change-Id: Ied34720ca5a6e6e717eea4e86003e854031b6eab Signed-off-by: Dave Barach --- src/plugins/map/map.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'src/plugins/map/map.c') diff --git a/src/plugins/map/map.c b/src/plugins/map/map.c index f2da818dd7b..13caa368322 100644 --- a/src/plugins/map/map.c +++ b/src/plugins/map/map.c @@ -130,7 +130,7 @@ map_create_domain (ip4_address_t * ip4_prefix, /* Get domain index */ pool_get_aligned (mm->domains, d, CLIB_CACHE_LINE_BYTES); - memset (d, 0, sizeof (*d)); + clib_memset (d, 0, sizeof (*d)); *map_domain_index = d - mm->domains; /* Init domain struct */ @@ -316,7 +316,7 @@ map_add_del_psid (u32 map_domain_index, u16 psid, ip6_address_t * tep, d->rules = clib_mem_alloc_aligned (l, CLIB_CACHE_LINE_BYTES); if (!d->rules) return -1; - memset (d->rules, 0, l); + clib_memset (d->rules, 0, l); } if (psid >= (0x1 << d->psid_length)) @@ -332,7 +332,7 @@ map_add_del_psid (u32 map_domain_index, u16 psid, ip6_address_t * tep, } else { - memset (&d->rules[psid], 0, sizeof (ip6_address_t)); + clib_memset (&d->rules[psid], 0, sizeof (ip6_address_t)); } return 0; } @@ -745,8 +745,8 @@ map_pre_resolve_command_fn (vlib_main_t * vm, clib_error_t *error = NULL; int is_del = 0; - memset (&ip4nh, 0, sizeof (ip4nh)); - memset (&ip6nh, 0, sizeof (ip6nh)); + clib_memset (&ip4nh, 0, sizeof (ip4nh)); + clib_memset (&ip6nh, 0, sizeof (ip6nh)); /* Get a line of input. */ if (!unformat_user (input, unformat_line_input, line_input)) @@ -974,7 +974,7 @@ format_map_domain (u8 * s, va_list * args) ip6_address_t ip6_prefix; if (d->rules) - memset (&ip6_prefix, 0, sizeof (ip6_prefix)); + clib_memset (&ip6_prefix, 0, sizeof (ip6_prefix)); else ip6_prefix = d->ip6_prefix; @@ -1210,8 +1210,8 @@ show_map_stats_command_fn (vlib_main_t * vm, unformat_input_t * input, int which, i; vlib_counter_t v; - memset (total_pkts, 0, sizeof (total_pkts)); - memset (total_bytes, 0, sizeof (total_bytes)); + clib_memset (total_pkts, 0, sizeof (total_pkts)); + clib_memset (total_bytes, 0, sizeof (total_bytes)); map_domain_counter_lock (mm); vec_foreach (cm, mm->domain_counters) -- cgit 1.2.3-korg