summaryrefslogtreecommitdiffstats
path: root/src/vnet/srv6
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/srv6
parentb9a4c445c1d4e9cdab476a8e1fb8a46ff0fc6080 (diff)
c11 safe string handling support
Change-Id: Ied34720ca5a6e6e717eea4e86003e854031b6eab Signed-off-by: Dave Barach <dave@barachs.net>
Diffstat (limited to 'src/vnet/srv6')
-rw-r--r--src/vnet/srv6/sr_api.c13
-rwxr-xr-xsrc/vnet/srv6/sr_localsid.c6
-rwxr-xr-xsrc/vnet/srv6/sr_policy_rewrite.c4
-rwxr-xr-xsrc/vnet/srv6/sr_steering.c6
4 files changed, 15 insertions, 14 deletions
diff --git a/src/vnet/srv6/sr_api.c b/src/vnet/srv6/sr_api.c
index c37923f7b01..46fb8293c64 100644
--- a/src/vnet/srv6/sr_api.c
+++ b/src/vnet/srv6/sr_api.c
@@ -71,7 +71,7 @@ static void vl_api_sr_localsid_add_del_t_handler
ip46_address_t prefix;
- memset (&prefix, 0, sizeof (ip46_address_t));
+ clib_memset (&prefix, 0, sizeof (ip46_address_t));
if ((mp->nh_addr4[0] | mp->nh_addr4[1] | mp->
nh_addr4[2] | mp->nh_addr4[3]) != 0)
memcpy (&prefix.ip4, mp->nh_addr4, sizeof (prefix.ip4));
@@ -210,7 +210,7 @@ static void send_sr_localsid_details
vl_api_sr_localsids_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_SR_LOCALSIDS_DETAILS);
clib_memcpy (rmp->addr.addr, &t->localsid, sizeof (ip6_address_t));
rmp->end_psp = t->end_psp;
@@ -261,9 +261,10 @@ static void send_sr_policies_details
rmp = vl_msg_api_alloc (sizeof (*rmp) +
vec_len (t->segments_lists) *
sizeof (vl_api_srv6_sid_list_t));
- memset (rmp, 0,
- (sizeof (*rmp) +
- vec_len (t->segments_lists) * sizeof (vl_api_srv6_sid_list_t)));
+ clib_memset (rmp, 0,
+ (sizeof (*rmp) +
+ vec_len (t->segments_lists) *
+ sizeof (vl_api_srv6_sid_list_t)));
rmp->_vl_msg_id = ntohs (VL_API_SR_POLICIES_DETAILS);
clib_memcpy (rmp->bsid.addr, &t->bsid, sizeof (ip6_address_t));
@@ -313,7 +314,7 @@ static void send_sr_steering_pol_details
ip6_sr_main_t *sm = &sr_main;
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_SR_STEERING_POL_DETAILS);
//Get the SR policy BSID
diff --git a/src/vnet/srv6/sr_localsid.c b/src/vnet/srv6/sr_localsid.c
index 58fdbfd551b..7aeb1b680b2 100755
--- a/src/vnet/srv6/sr_localsid.c
+++ b/src/vnet/srv6/sr_localsid.c
@@ -146,7 +146,7 @@ sr_cli_localsid (char is_del, ip6_address_t * localsid_addr,
/* Create a new localsid registry */
pool_get (sm->localsids, ls);
- memset (ls, 0, sizeof (*ls));
+ clib_memset (ls, 0, sizeof (*ls));
clib_memcpy (&ls->localsid, localsid_addr, sizeof (ip6_address_t));
ls->end_psp = end_psp;
@@ -276,7 +276,7 @@ sr_cli_localsid_command_fn (vlib_main_t * vm, unformat_input_t * input,
int rv;
- memset (&resulting_address, 0, sizeof (ip6_address_t));
+ clib_memset (&resulting_address, 0, sizeof (ip6_address_t));
ip46_address_reset (&next_hop);
while (unformat_check_input (input) != UNFORMAT_END_OF_INPUT)
@@ -1549,7 +1549,7 @@ sr_localsid_register_function (vlib_main_t * vm, u8 * fn_name,
plugin - sm->plugin_functions);
}
- memset (plugin, 0, sizeof (*plugin));
+ clib_memset (plugin, 0, sizeof (*plugin));
plugin->sr_localsid_function_number = (plugin - sm->plugin_functions);
plugin->sr_localsid_function_number += SR_BEHAVIOR_LAST;
diff --git a/src/vnet/srv6/sr_policy_rewrite.c b/src/vnet/srv6/sr_policy_rewrite.c
index 62ce224cd8e..c80b9c4505a 100755
--- a/src/vnet/srv6/sr_policy_rewrite.c
+++ b/src/vnet/srv6/sr_policy_rewrite.c
@@ -301,7 +301,7 @@ create_sl (ip6_sr_policy_t * sr_policy, ip6_address_t * sl, u32 weight,
ip6_sr_sl_t *segment_list;
pool_get (sm->sid_lists, segment_list);
- memset (segment_list, 0, sizeof (*segment_list));
+ clib_memset (segment_list, 0, sizeof (*segment_list));
vec_add1 (sr_policy->segments_lists, segment_list - sm->sid_lists);
@@ -588,7 +588,7 @@ sr_policy_add (ip6_address_t * bsid, ip6_address_t * segments,
/* Add an SR policy object */
pool_get (sm->sr_policies, sr_policy);
- memset (sr_policy, 0, sizeof (*sr_policy));
+ clib_memset (sr_policy, 0, sizeof (*sr_policy));
clib_memcpy (&sr_policy->bsid, bsid, sizeof (ip6_address_t));
sr_policy->type = behavior;
sr_policy->fib_table = (fib_table != (u32) ~ 0 ? fib_table : 0); //Is default FIB 0 ?
diff --git a/src/vnet/srv6/sr_steering.c b/src/vnet/srv6/sr_steering.c
index a888fea9fda..d44bbae576f 100755
--- a/src/vnet/srv6/sr_steering.c
+++ b/src/vnet/srv6/sr_steering.c
@@ -69,7 +69,7 @@ sr_steering_policy (int is_del, ip6_address_t * bsid, u32 sr_policy_index,
ip6_sr_policy_t *sr_policy = 0;
uword *p = 0;
- memset (&key, 0, sizeof (sr_steering_key_t));
+ clib_memset (&key, 0, sizeof (sr_steering_key_t));
/* Compute the steer policy key */
if (traffic_type == SR_STEER_IPV4 || traffic_type == SR_STEER_IPV6)
@@ -245,7 +245,7 @@ sr_steering_policy (int is_del, ip6_address_t * bsid, u32 sr_policy_index,
/* Create a new steering policy */
pool_get (sm->steer_policies, steer_pl);
- memset (steer_pl, 0, sizeof (*steer_pl));
+ clib_memset (steer_pl, 0, sizeof (*steer_pl));
if (traffic_type == SR_STEER_IPV4 || traffic_type == SR_STEER_IPV6)
{
@@ -379,7 +379,7 @@ sr_steer_policy_command_fn (vlib_main_t * vm, unformat_input_t * input,
u8 sr_policy_set = 0;
- memset (&prefix, 0, sizeof (ip46_address_t));
+ clib_memset (&prefix, 0, sizeof (ip46_address_t));
int rv;
while (unformat_check_input (input) != UNFORMAT_END_OF_INPUT)