aboutsummaryrefslogtreecommitdiffstats
path: root/src/vnet/session
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/session
parentb9a4c445c1d4e9cdab476a8e1fb8a46ff0fc6080 (diff)
c11 safe string handling support
Change-Id: Ied34720ca5a6e6e717eea4e86003e854031b6eab Signed-off-by: Dave Barach <dave@barachs.net>
Diffstat (limited to 'src/vnet/session')
-rw-r--r--src/vnet/session/application.c24
-rw-r--r--src/vnet/session/application_interface.h2
-rw-r--r--src/vnet/session/application_namespace.c2
-rw-r--r--src/vnet/session/mma_template.c4
-rw-r--r--src/vnet/session/segment_manager.c8
-rw-r--r--src/vnet/session/session.c6
-rwxr-xr-xsrc/vnet/session/session_api.c48
-rwxr-xr-xsrc/vnet/session/session_cli.c4
-rw-r--r--src/vnet/session/session_lookup.c18
-rw-r--r--src/vnet/session/session_node.c2
-rw-r--r--src/vnet/session/session_rules_table.c6
-rw-r--r--src/vnet/session/session_table.c2
-rw-r--r--src/vnet/session/session_test.c12
-rw-r--r--src/vnet/session/transport.c2
14 files changed, 70 insertions, 70 deletions
diff --git a/src/vnet/session/application.c b/src/vnet/session/application.c
index fad3e1c2292..90c067d6d31 100644
--- a/src/vnet/session/application.c
+++ b/src/vnet/session/application.c
@@ -25,7 +25,7 @@ app_listener_alloc (application_t * app)
{
app_listener_t *app_listener;
pool_get (app->listeners, app_listener);
- memset (app_listener, 0, sizeof (*app_listener));
+ clib_memset (app_listener, 0, sizeof (*app_listener));
app_listener->al_index = app_listener - app->listeners;
return app_listener;
}
@@ -42,7 +42,7 @@ app_listener_free (application_t * app, app_listener_t * app_listener)
clib_bitmap_free (app_listener->workers);
pool_put (app->listeners, app_listener);
if (CLIB_DEBUG)
- memset (app_listener, 0xfa, sizeof (*app_listener));
+ clib_memset (app_listener, 0xfa, sizeof (*app_listener));
}
static app_listener_t *
@@ -50,7 +50,7 @@ app_local_listener_alloc (application_t * app)
{
app_listener_t *app_listener;
pool_get (app->local_listeners, app_listener);
- memset (app_listener, 0, sizeof (*app_listener));
+ clib_memset (app_listener, 0, sizeof (*app_listener));
app_listener->al_index = app_listener - app->local_listeners;
return app_listener;
}
@@ -67,7 +67,7 @@ app_local_listener_free (application_t * app, app_listener_t * app_listener)
clib_bitmap_free (app_listener->workers);
pool_put (app->local_listeners, app_listener);
if (CLIB_DEBUG)
- memset (app_listener, 0xfa, sizeof (*app_listener));
+ clib_memset (app_listener, 0xfa, sizeof (*app_listener));
}
static app_worker_map_t *
@@ -75,7 +75,7 @@ app_worker_map_alloc (application_t * app)
{
app_worker_map_t *map;
pool_get (app->worker_maps, map);
- memset (map, 0, sizeof (*map));
+ clib_memset (map, 0, sizeof (*map));
return map;
}
@@ -234,7 +234,7 @@ application_alloc (void)
{
application_t *app;
pool_get (app_main.app_pool, app);
- memset (app, 0, sizeof (*app));
+ clib_memset (app, 0, sizeof (*app));
app->app_index = app - app_main.app_pool;
return app;
}
@@ -484,7 +484,7 @@ app_worker_alloc (application_t * app)
{
app_worker_t *app_wrk;
pool_get (app_main.workers, app_wrk);
- memset (app_wrk, 0, sizeof (*app_wrk));
+ clib_memset (app_wrk, 0, sizeof (*app_wrk));
app_wrk->wrk_index = app_wrk - app_main.workers;
app_wrk->app_index = app->app_index;
app_wrk->wrk_map_index = ~0;
@@ -572,7 +572,7 @@ app_worker_free (app_worker_t * app_wrk)
pool_put (app_main.workers, app_wrk);
if (CLIB_DEBUG)
- memset (app_wrk, 0xfe, sizeof (*app_wrk));
+ clib_memset (app_wrk, 0xfe, sizeof (*app_wrk));
}
int
@@ -1347,7 +1347,7 @@ application_local_session_alloc (app_worker_t * app_wrk)
{
local_session_t *s;
pool_get (app_wrk->local_sessions, s);
- memset (s, 0, sizeof (*s));
+ clib_memset (s, 0, sizeof (*s));
s->app_wrk_index = app_wrk->wrk_index;
s->session_index = s - app_wrk->local_sessions;
s->session_type = session_type_from_proto_and_ip (TRANSPORT_PROTO_NONE, 0);
@@ -1359,7 +1359,7 @@ application_local_session_free (app_worker_t * app, local_session_t * s)
{
pool_put (app->local_sessions, s);
if (CLIB_DEBUG)
- memset (s, 0xfc, sizeof (*s));
+ clib_memset (s, 0xfc, sizeof (*s));
}
local_session_t *
@@ -1387,7 +1387,7 @@ application_local_listen_session_alloc (application_t * app)
{
local_session_t *ll;
pool_get (app->local_listen_sessions, ll);
- memset (ll, 0, sizeof (*ll));
+ clib_memset (ll, 0, sizeof (*ll));
return ll;
}
@@ -1403,7 +1403,7 @@ application_local_listen_session_free (application_t * app,
{
pool_put (app->local_listen_sessions, ll);
if (CLIB_DEBUG)
- memset (ll, 0xfb, sizeof (*ll));
+ clib_memset (ll, 0xfb, sizeof (*ll));
}
int
diff --git a/src/vnet/session/application_interface.h b/src/vnet/session/application_interface.h
index 5b28a29c45b..c8ceb4e07a5 100644
--- a/src/vnet/session/application_interface.h
+++ b/src/vnet/session/application_interface.h
@@ -314,7 +314,7 @@ app_alloc_ctrl_evt_to_vpp (svm_msg_q_t * mq, app_session_evt_t * app_evt,
SVM_Q_WAIT, &app_evt->msg);
svm_msg_q_unlock (mq);
app_evt->evt = svm_msg_q_msg_data (mq, &app_evt->msg);
- memset (app_evt->evt, 0, sizeof (*app_evt->evt));
+ clib_memset (app_evt->evt, 0, sizeof (*app_evt->evt));
app_evt->evt->event_type = evt_type;
}
diff --git a/src/vnet/session/application_namespace.c b/src/vnet/session/application_namespace.c
index ce44547a86d..1896a723115 100644
--- a/src/vnet/session/application_namespace.c
+++ b/src/vnet/session/application_namespace.c
@@ -54,7 +54,7 @@ app_namespace_alloc (u8 * ns_id)
{
app_namespace_t *app_ns;
pool_get (app_namespace_pool, app_ns);
- memset (app_ns, 0, sizeof (*app_ns));
+ clib_memset (app_ns, 0, sizeof (*app_ns));
app_ns->ns_id = vec_dup (ns_id);
hash_set_mem (app_namespace_lookup_table, app_ns->ns_id,
app_ns - app_namespace_pool);
diff --git a/src/vnet/session/mma_template.c b/src/vnet/session/mma_template.c
index 248ced61451..15fd7c7aeed 100644
--- a/src/vnet/session/mma_template.c
+++ b/src/vnet/session/mma_template.c
@@ -53,7 +53,7 @@ RTT (mma_rule) * RT (mma_rules_table_rule_alloc) (RTT (mma_rules_table) * srt)
{
RTT (mma_rule) * rule;
pool_get (srt->rules, rule);
- memset (rule, 0, sizeof (*rule));
+ clib_memset (rule, 0, sizeof (*rule));
return rule;
}
@@ -61,7 +61,7 @@ RTT (mma_rule) *
RT (mma_rule_free) (RTT (mma_rules_table) * srt, RTT (mma_rule) * rule)
{
pool_put (srt->rules, rule);
- memset (rule, 0xfa, sizeof (*rule));
+ clib_memset (rule, 0xfa, sizeof (*rule));
return rule;
}
diff --git a/src/vnet/session/segment_manager.c b/src/vnet/session/segment_manager.c
index 8dd72928ec4..6386645a974 100644
--- a/src/vnet/session/segment_manager.c
+++ b/src/vnet/session/segment_manager.c
@@ -82,7 +82,7 @@ segment_manager_del_segment (segment_manager_t * sm,
ssvm_delete (&fs->ssvm);
if (CLIB_DEBUG)
- memset (fs, 0xfb, sizeof (*fs));
+ clib_memset (fs, 0xfb, sizeof (*fs));
pool_put (sm->segments, fs);
}
@@ -182,7 +182,7 @@ segment_manager_add_segment (segment_manager_t * sm, u32 segment_size)
{
pool_get (sm->segments, seg);
}
- memset (seg, 0, sizeof (*seg));
+ clib_memset (seg, 0, sizeof (*seg));
/*
* Initialize ssvm segment and svm fifo private header
@@ -238,7 +238,7 @@ segment_manager_new ()
segment_manager_main_t *smm = &segment_manager_main;
segment_manager_t *sm;
pool_get (smm->segment_managers, sm);
- memset (sm, 0, sizeof (*sm));
+ clib_memset (sm, 0, sizeof (*sm));
clib_rwlock_init (&sm->segments_rwlock);
return sm;
}
@@ -419,7 +419,7 @@ segment_manager_del (segment_manager_t * sm)
clib_rwlock_free (&sm->segments_rwlock);
if (CLIB_DEBUG)
- memset (sm, 0xfe, sizeof (*sm));
+ clib_memset (sm, 0xfe, sizeof (*sm));
pool_put (smm->segment_managers, sm);
}
diff --git a/src/vnet/session/session.c b/src/vnet/session/session.c
index 81c93064d38..189c5375fbb 100644
--- a/src/vnet/session/session.c
+++ b/src/vnet/session/session.c
@@ -139,7 +139,7 @@ session_alloc (u32 thread_index)
pool_get_aligned (session_manager_main.sessions[thread_index], s,
CLIB_CACHE_LINE_BYTES);
}
- memset (s, 0, sizeof (*s));
+ clib_memset (s, 0, sizeof (*s));
s->session_index = s - session_manager_main.sessions[thread_index];
s->thread_index = thread_index;
return s;
@@ -150,7 +150,7 @@ session_free (stream_session_t * s)
{
pool_put (session_manager_main.sessions[s->thread_index], s);
if (CLIB_DEBUG)
- memset (s, 0xFA, sizeof (*s));
+ clib_memset (s, 0xFA, sizeof (*s));
}
void
@@ -1087,7 +1087,7 @@ stream_session_disconnect (stream_session_t * s)
if (vlib_thread_is_main_w_barrier () || thread_index == s->thread_index)
{
vec_add2 (smm->pending_disconnects[s->thread_index], evt, 1);
- memset (evt, 0, sizeof (*evt));
+ clib_memset (evt, 0, sizeof (*evt));
evt->session_handle = session_handle (s);
evt->event_type = FIFO_EVENT_DISCONNECT;
}
diff --git a/src/vnet/session/session_api.c b/src/vnet/session/session_api.c
index 56593865381..f0273641e7f 100755
--- a/src/vnet/session/session_api.c
+++ b/src/vnet/session/session_api.c
@@ -107,7 +107,7 @@ send_add_segment_callback (u32 api_client_index, const ssvm_private_t * sp)
}
mp = vl_mem_api_alloc_as_if_client_w_reg (reg, sizeof (*mp));
- memset (mp, 0, sizeof (*mp));
+ clib_memset (mp, 0, sizeof (*mp));
mp->_vl_msg_id = clib_host_to_net_u16 (VL_API_MAP_ANOTHER_SEGMENT);
mp->segment_size = sp->ssvm_size;
mp->fd_flags = fd_flags;
@@ -136,7 +136,7 @@ send_del_segment_callback (u32 api_client_index, const ssvm_private_t * fs)
}
mp = vl_mem_api_alloc_as_if_client_w_reg (reg, sizeof (*mp));
- memset (mp, 0, sizeof (*mp));
+ clib_memset (mp, 0, sizeof (*mp));
mp->_vl_msg_id = clib_host_to_net_u16 (VL_API_UNMAP_SEGMENT);
strncpy ((char *) mp->segment_name, (char *) fs->name,
sizeof (mp->segment_name) - 1);
@@ -164,7 +164,7 @@ send_app_cut_through_registration_add (u32 api_client_index,
}
mp = vl_mem_api_alloc_as_if_client_w_reg (reg, sizeof (*mp));
- memset (mp, 0, sizeof (*mp));
+ clib_memset (mp, 0, sizeof (*mp));
mp->_vl_msg_id =
clib_host_to_net_u16 (VL_API_APP_CUT_THROUGH_REGISTRATION_ADD);
@@ -215,7 +215,7 @@ send_session_accept_callback (stream_session_t * s)
}
mp = vl_mem_api_alloc_as_if_client_w_reg (reg, sizeof (*mp));
- memset (mp, 0, sizeof (*mp));
+ clib_memset (mp, 0, sizeof (*mp));
mp->_vl_msg_id = clib_host_to_net_u16 (VL_API_ACCEPT_SESSION);
mp->context = server_wrk->wrk_index;
@@ -295,7 +295,7 @@ send_session_disconnect_callback (stream_session_t * s)
}
mp = vl_mem_api_alloc_as_if_client_w_reg (reg, sizeof (*mp));
- memset (mp, 0, sizeof (*mp));
+ clib_memset (mp, 0, sizeof (*mp));
mp->_vl_msg_id = clib_host_to_net_u16 (VL_API_DISCONNECT_SESSION);
mp->handle = session_handle (s);
mp->context = app->api_client_index;
@@ -319,7 +319,7 @@ send_session_reset_callback (stream_session_t * s)
}
mp = vl_mem_api_alloc_as_if_client_w_reg (reg, sizeof (*mp));
- memset (mp, 0, sizeof (*mp));
+ clib_memset (mp, 0, sizeof (*mp));
mp->_vl_msg_id = clib_host_to_net_u16 (VL_API_RESET_SESSION);
mp->handle = session_handle (s);
vl_msg_api_send_shmem (reg->vl_input_queue, (u8 *) & mp);
@@ -433,7 +433,7 @@ mq_send_session_accepted_cb (stream_session_t * s)
return -1;
evt = svm_msg_q_msg_data (app_mq, msg);
- memset (evt, 0, sizeof (*evt));
+ clib_memset (evt, 0, sizeof (*evt));
evt->event_type = SESSION_CTRL_EVT_ACCEPTED;
mp = (session_accepted_msg_t *) evt->data;
mp->context = app->app_index;
@@ -519,7 +519,7 @@ mq_send_session_disconnected_cb (stream_session_t * s)
if (mq_try_lock_and_alloc_msg (app_mq, msg))
return;
evt = svm_msg_q_msg_data (app_mq, msg);
- memset (evt, 0, sizeof (*evt));
+ clib_memset (evt, 0, sizeof (*evt));
evt->event_type = SESSION_CTRL_EVT_DISCONNECTED;
mp = (session_disconnected_msg_t *) evt->data;
mp->handle = session_handle (s);
@@ -543,7 +543,7 @@ mq_send_local_session_disconnected_cb (u32 app_wrk_index,
if (mq_try_lock_and_alloc_msg (app_mq, msg))
return;
evt = svm_msg_q_msg_data (app_mq, msg);
- memset (evt, 0, sizeof (*evt));
+ clib_memset (evt, 0, sizeof (*evt));
evt->event_type = SESSION_CTRL_EVT_DISCONNECTED;
mp = (session_disconnected_msg_t *) evt->data;
mp->handle = application_local_session_handle (ls);
@@ -564,7 +564,7 @@ mq_send_session_reset_cb (stream_session_t * s)
if (mq_try_lock_and_alloc_msg (app_mq, msg))
return;
evt = svm_msg_q_msg_data (app_mq, msg);
- memset (evt, 0, sizeof (*evt));
+ clib_memset (evt, 0, sizeof (*evt));
evt->event_type = SESSION_CTRL_EVT_RESET;
mp = (session_reset_msg_t *) evt->data;
mp->handle = session_handle (s);
@@ -596,7 +596,7 @@ mq_send_session_connected_cb (u32 app_wrk_index, u32 api_context,
if (mq_try_lock_and_alloc_msg (app_mq, msg))
return -1;
evt = svm_msg_q_msg_data (app_mq, msg);
- memset (evt, 0, sizeof (*evt));
+ clib_memset (evt, 0, sizeof (*evt));
evt->event_type = SESSION_CTRL_EVT_CONNECTED;
mp = (session_connected_msg_t *) evt->data;
mp->context = api_context;
@@ -677,7 +677,7 @@ mq_send_session_bound_cb (u32 app_wrk_index, u32 api_context,
return -1;
evt = svm_msg_q_msg_data (app_mq, msg);
- memset (evt, 0, sizeof (*evt));
+ clib_memset (evt, 0, sizeof (*evt));
evt->event_type = SESSION_CTRL_EVT_BOUND;
mp = (session_bound_msg_t *) evt->data;
mp->context = api_context;
@@ -761,7 +761,7 @@ vl_api_application_attach_t_handler (vl_api_application_attach_t * mp)
sizeof (mp->options),
"Out of options, fix api message definition");
- memset (a, 0, sizeof (*a));
+ clib_memset (a, 0, sizeof (*a));
a->api_client_index = mp->client_index;
a->options = mp->options;
@@ -883,7 +883,7 @@ vl_api_bind_uri_t_handler (vl_api_bind_uri_t * mp)
app = application_lookup (mp->client_index);
if (app)
{
- memset (a, 0, sizeof (*a));
+ clib_memset (a, 0, sizeof (*a));
a->uri = (char *) mp->uri;
a->app_index = app->app_index;
rv = vnet_bind_uri (a);
@@ -976,7 +976,7 @@ vl_api_connect_uri_t_handler (vl_api_connect_uri_t * mp)
app = application_lookup (mp->client_index);
if (app)
{
- memset (a, 0, sizeof (*a));
+ clib_memset (a, 0, sizeof (*a));
a->uri = (char *) mp->uri;
a->api_context = mp->context;
a->app_index = app->app_index;
@@ -1180,7 +1180,7 @@ vl_api_bind_sock_t_handler (vl_api_bind_sock_t * mp)
}
ip46 = (ip46_address_t *) mp->ip;
- memset (a, 0, sizeof (*a));
+ clib_memset (a, 0, sizeof (*a));
a->sep.is_ip4 = mp->is_ip4;
a->sep.ip = *ip46;
a->sep.port = mp->port;
@@ -1283,7 +1283,7 @@ vl_api_connect_sock_t_handler (vl_api_connect_sock_t * mp)
svm_queue_t *client_q;
ip46_address_t *ip46 = (ip46_address_t *) mp->ip;
- memset (a, 0, sizeof (*a));
+ clib_memset (a, 0, sizeof (*a));
client_q = vl_api_client_index_to_input_queue (mp->client_index);
mp->client_queue_address = pointer_to_uword (client_q);
a->sep.is_ip4 = mp->is_ip4;
@@ -1474,7 +1474,7 @@ vl_api_session_rule_add_del_t_handler (vl_api_session_rule_add_del_t * mp)
u8 fib_proto;
int rv = 0;
- memset (&args, 0, sizeof (args));
+ clib_memset (&args, 0, sizeof (args));
fib_proto = mp->is_ip4 ? FIB_PROTOCOL_IP4 : FIB_PROTOCOL_IP6;
table_args->lcl.fp_len = mp->lcl_plen;
@@ -1491,8 +1491,8 @@ vl_api_session_rule_add_del_t_handler (vl_api_session_rule_add_del_t * mp)
args.scope = mp->scope;
args.transport_proto = mp->transport_proto;
- memset (&table_args->lcl.fp_addr, 0, sizeof (table_args->lcl.fp_addr));
- memset (&table_args->rmt.fp_addr, 0, sizeof (table_args->rmt.fp_addr));
+ clib_memset (&table_args->lcl.fp_addr, 0, sizeof (table_args->lcl.fp_addr));
+ clib_memset (&table_args->rmt.fp_addr, 0, sizeof (table_args->rmt.fp_addr));
ip_set (&table_args->lcl.fp_addr, mp->lcl_ip, mp->is_ip4);
ip_set (&table_args->rmt.fp_addr, mp->rmt_ip, mp->is_ip4);
error = vnet_session_rule_add_del (&args);
@@ -1517,7 +1517,7 @@ send_session_rule_details4 (mma_rule_16_t * rule, u8 is_local,
(session_mask_or_match_4_t *) & rule->mask;
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_SESSION_RULES_DETAILS);
rmp->context = context;
@@ -1554,7 +1554,7 @@ send_session_rule_details6 (mma_rule_40_t * rule, u8 is_local,
(session_mask_or_match_6_t *) & rule->mask;
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_SESSION_RULES_DETAILS);
rmp->context = context;
@@ -1662,7 +1662,7 @@ vl_api_application_tls_cert_add_t_handler (vl_api_application_tls_cert_add_t *
rv = VNET_API_ERROR_APPLICATION_NOT_ATTACHED;
goto done;
}
- memset (a, 0, sizeof (*a));
+ clib_memset (a, 0, sizeof (*a));
a->app_index = app->app_index;
cert_len = clib_net_to_host_u16 (mp->cert_len);
if (cert_len > 10000)
@@ -1702,7 +1702,7 @@ vl_api_application_tls_key_add_t_handler (vl_api_application_tls_key_add_t *
rv = VNET_API_ERROR_APPLICATION_NOT_ATTACHED;
goto done;
}
- memset (a, 0, sizeof (*a));
+ clib_memset (a, 0, sizeof (*a));
a->app_index = app->app_index;
key_len = clib_net_to_host_u16 (mp->key_len);
if (key_len > 10000)
diff --git a/src/vnet/session/session_cli.c b/src/vnet/session/session_cli.c
index 36133523e34..57f3d3ad7f1 100755
--- a/src/vnet/session/session_cli.c
+++ b/src/vnet/session/session_cli.c
@@ -109,8 +109,8 @@ unformat_stream_session_id (unformat_input_t * input, va_list * args)
u8 *is_ip4 = va_arg (*args, u8 *);
u8 tuple_is_set = 0;
- memset (lcl, 0, sizeof (*lcl));
- memset (rmt, 0, sizeof (*rmt));
+ clib_memset (lcl, 0, sizeof (*lcl));
+ clib_memset (rmt, 0, sizeof (*rmt));
if (unformat (input, "tcp"))
{
diff --git a/src/vnet/session/session_lookup.c b/src/vnet/session/session_lookup.c
index 19aeb0b24e0..927922e7e64 100644
--- a/src/vnet/session/session_lookup.c
+++ b/src/vnet/session/session_lookup.c
@@ -460,7 +460,7 @@ session_lookup_endpoint_listener (u32 table_index, session_endpoint_t * sep,
return kv4.value;
if (use_rules)
{
- memset (&lcl4, 0, sizeof (lcl4));
+ clib_memset (&lcl4, 0, sizeof (lcl4));
srt = &st->session_rules[sep->transport_proto];
ai = session_rules_table_lookup4 (srt, &lcl4, &sep->ip.ip4, 0,
sep->port);
@@ -481,7 +481,7 @@ session_lookup_endpoint_listener (u32 table_index, session_endpoint_t * sep,
if (use_rules)
{
- memset (&lcl6, 0, sizeof (lcl6));
+ clib_memset (&lcl6, 0, sizeof (lcl6));
srt = &st->session_rules[sep->transport_proto];
ai = session_rules_table_lookup6 (srt, &lcl6, &sep->ip.ip6, 0,
sep->port);
@@ -529,7 +529,7 @@ session_lookup_local_endpoint (u32 table_index, session_endpoint_t * sep)
/*
* Check if endpoint has special rules associated
*/
- memset (&lcl4, 0, sizeof (lcl4));
+ clib_memset (&lcl4, 0, sizeof (lcl4));
srt = &st->session_rules[sep->transport_proto];
ai = session_rules_table_lookup4 (srt, &lcl4, &sep->ip.ip4, 0,
sep->port);
@@ -574,7 +574,7 @@ session_lookup_local_endpoint (u32 table_index, session_endpoint_t * sep)
session_kv6_t kv6;
ip6_address_t lcl6;
- memset (&lcl6, 0, sizeof (lcl6));
+ clib_memset (&lcl6, 0, sizeof (lcl6));
srt = &st->session_rules[sep->transport_proto];
ai = session_rules_table_lookup6 (srt, &lcl6, &sep->ip.ip6, 0,
sep->port);
@@ -1267,7 +1267,7 @@ vnet_session_rule_add_del (session_rule_add_del_args_t * args)
}
if (args->scope & SESSION_RULE_SCOPE_LOCAL)
{
- memset (&args->table_args.lcl, 0, sizeof (args->table_args.lcl));
+ clib_memset (&args->table_args.lcl, 0, sizeof (args->table_args.lcl));
args->table_args.lcl.fp_proto = args->table_args.rmt.fp_proto;
args->table_args.lcl_port = 0;
st = app_namespace_get_local_table (app_ns);
@@ -1383,8 +1383,8 @@ session_rule_command_fn (vlib_main_t * vm, unformat_input_t * input,
app_namespace_t *app_ns;
clib_error_t *error;
- memset (&lcl_ip, 0, sizeof (lcl_ip));
- memset (&rmt_ip, 0, sizeof (rmt_ip));
+ clib_memset (&lcl_ip, 0, sizeof (lcl_ip));
+ clib_memset (&rmt_ip, 0, sizeof (rmt_ip));
while (unformat_check_input (input) != UNFORMAT_END_OF_INPUT)
{
if (unformat (input, "del"))
@@ -1530,8 +1530,8 @@ show_session_rules_command_fn (vlib_main_t * vm, unformat_input_t * input,
session_table_t *st;
u8 *ns_id = 0, fib_proto;
- memset (&lcl_ip, 0, sizeof (lcl_ip));
- memset (&rmt_ip, 0, sizeof (rmt_ip));
+ clib_memset (&lcl_ip, 0, sizeof (lcl_ip));
+ clib_memset (&rmt_ip, 0, sizeof (rmt_ip));
while (unformat_check_input (input) != UNFORMAT_END_OF_INPUT)
{
if (unformat (input, "%U", unformat_transport_proto, &transport_proto))
diff --git a/src/vnet/session/session_node.c b/src/vnet/session/session_node.c
index 281622bcc9b..c1aea6723b6 100644
--- a/src/vnet/session/session_node.c
+++ b/src/vnet/session/session_node.c
@@ -159,7 +159,7 @@ session_mq_disconnected_handler (void *data)
SVM_Q_WAIT, msg);
svm_msg_q_unlock (app_wrk->event_queue);
evt = svm_msg_q_msg_data (app_wrk->event_queue, msg);
- memset (evt, 0, sizeof (*evt));
+ clib_memset (evt, 0, sizeof (*evt));
evt->event_type = SESSION_CTRL_EVT_DISCONNECTED;
rmp = (session_disconnected_reply_msg_t *) evt->data;
rmp->handle = mp->handle;
diff --git a/src/vnet/session/session_rules_table.c b/src/vnet/session/session_rules_table.c
index dee445dd0ad..33f7de07944 100644
--- a/src/vnet/session/session_rules_table.c
+++ b/src/vnet/session/session_rules_table.c
@@ -445,7 +445,7 @@ session_rules_table_add_del (session_rules_table_t * srt,
{
mma_rule_16_t _rule;
rule = &_rule;
- memset (rule, 0, sizeof (*rule));
+ clib_memset (rule, 0, sizeof (*rule));
session_rules_table_init_rule_16 (rule, &args->lcl,
args->lcl_port, &args->rmt,
args->rmt_port);
@@ -499,7 +499,7 @@ session_rules_table_add_del (session_rules_table_t * srt,
{
mma_rule_40_t _rule;
rule = &_rule;
- memset (rule, 0, sizeof (*rule));
+ clib_memset (rule, 0, sizeof (*rule));
session_rules_table_init_rule_40 (rule, &args->lcl,
args->lcl_port, &args->rmt,
args->rmt_port);
@@ -522,7 +522,7 @@ session_rules_table_init (session_rules_table_t * srt)
mma_rule_40_t *rule6;
fib_prefix_t null_prefix;
- memset (&null_prefix, 0, sizeof (null_prefix));
+ clib_memset (&null_prefix, 0, sizeof (null_prefix));
srt4 = &srt->session_rules_tables_16;
rule4 = session_rules_table_alloc_rule_16 (srt4, &null_prefix, 0,
diff --git a/src/vnet/session/session_table.c b/src/vnet/session/session_table.c
index 47d19092e2b..c74e290bda7 100644
--- a/src/vnet/session/session_table.c
+++ b/src/vnet/session/session_table.c
@@ -32,7 +32,7 @@ session_table_alloc (void)
{
session_table_t *slt;
pool_get_aligned (lookup_tables, slt, CLIB_CACHE_LINE_BYTES);
- memset (slt, 0, sizeof (*slt));
+ clib_memset (slt, 0, sizeof (*slt));
return slt;
}
diff --git a/src/vnet/session/session_test.c b/src/vnet/session/session_test.c
index 058644d91d4..8fe1b0d36e0 100644
--- a/src/vnet/session/session_test.c
+++ b/src/vnet/session/session_test.c
@@ -110,7 +110,7 @@ session_create_lookpback (u32 table_id, u32 * sw_if_index,
{
u8 intf_mac[6];
- memset (intf_mac, 0, sizeof (intf_mac));
+ clib_memset (intf_mac, 0, sizeof (intf_mac));
if (vnet_create_loopback_interface (sw_if_index, intf_mac, 0, 0))
{
@@ -150,7 +150,7 @@ session_test_basic (vlib_main_t * vm, unformat_input_t * input)
clib_error_t *error = 0;
u32 server_index;
- memset (options, 0, sizeof (options));
+ clib_memset (options, 0, sizeof (options));
options[APP_OPTIONS_FLAGS] = APP_OPTIONS_FLAGS_IS_BUILTIN;
options[APP_OPTIONS_FLAGS] |= APP_OPTIONS_FLAGS_USE_GLOBAL_SCOPE;
options[APP_OPTIONS_FLAGS] |= APP_OPTIONS_FLAGS_USE_LOCAL_SCOPE;
@@ -230,7 +230,7 @@ session_test_namespace (vlib_main_t * vm, unformat_input_t * input)
server_sep.port = dummy_port;
client_sep.is_ip4 = 1;
client_sep.port = dummy_port;
- memset (options, 0, sizeof (options));
+ clib_memset (options, 0, sizeof (options));
options[APP_OPTIONS_FLAGS] = APP_OPTIONS_FLAGS_IS_BUILTIN;
vnet_app_attach_args_t attach_args = {
@@ -559,7 +559,7 @@ session_test_rule_table (vlib_main_t * vm, unformat_input_t * input)
}
}
- memset (srt, 0, sizeof (*srt));
+ clib_memset (srt, 0, sizeof (*srt));
session_rules_table_init (srt);
ip4_address_t lcl_ip = {
@@ -839,7 +839,7 @@ session_test_rules (vlib_main_t * vm, unformat_input_t * input)
server_sep.is_ip4 = 1;
server_sep.port = dummy_port;
- memset (options, 0, sizeof (options));
+ clib_memset (options, 0, sizeof (options));
vnet_app_attach_args_t attach_args = {
.api_client_index = ~0,
@@ -1424,7 +1424,7 @@ session_test_proxy (vlib_main_t * vm, unformat_input_t * input)
app_ns = app_namespace_get_default ();
app_ns->sw_if_index = sw_if_index;
- memset (options, 0, sizeof (options));
+ clib_memset (options, 0, sizeof (options));
options[APP_OPTIONS_FLAGS] = APP_OPTIONS_FLAGS_IS_BUILTIN;
options[APP_OPTIONS_FLAGS] |= APP_OPTIONS_FLAGS_ACCEPT_REDIRECT;
options[APP_OPTIONS_FLAGS] |= APP_OPTIONS_FLAGS_IS_PROXY;
diff --git a/src/vnet/session/transport.c b/src/vnet/session/transport.c
index a401190e426..d74a218a5bf 100644
--- a/src/vnet/session/transport.c
+++ b/src/vnet/session/transport.c
@@ -336,7 +336,7 @@ transport_alloc_local_endpoint (u8 proto, transport_endpoint_t * rmt,
return -1;
}
- memset (lcl_addr, 0, sizeof (*lcl_addr));
+ clib_memset (lcl_addr, 0, sizeof (*lcl_addr));
if (rmt->is_ip4)
{