c11 safe string handling support
[vpp.git] / src / vnet / session / session_cli.c
index 3588bbc..57f3d3a 100755 (executable)
@@ -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"))
     {
@@ -250,7 +250,7 @@ show_session_command_fn (vlib_main_t * vm, unformat_input_t * input,
        if (s->session_state != SESSION_STATE_LISTENING
            || s->session_type != sst)
          continue;
-       app_name = application_name_from_index (s->app_index);
+       app_name = application_name_from_index (s->app_wrk_index);
        vlib_cli_output (vm, "%U%-25v%-10u", format_stream_session, s, 1,
                         app_name, s->session_index);
        vec_free (app_name);
@@ -314,7 +314,8 @@ VLIB_CLI_COMMAND (vlib_cli_show_session_command) =
 static int
 clear_session (stream_session_t * s)
 {
-  application_t *server = application_get (s->app_index);
+  app_worker_t *server_wrk = app_worker_get (s->app_wrk_index);
+  application_t *server = application_get (server_wrk->app_index);
   server->cb_fns.session_disconnect_callback (s);
   return 0;
 }