c11 safe string handling support
[vpp.git] / src / vnet / session / session_test.c
index 6f162a8..8fe1b0d 100644 (file)
@@ -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 = {
@@ -262,7 +262,7 @@ session_test_namespace (vlib_main_t * vm, unformat_input_t * input)
   };
 
   ip4_address_t intf_addr = {
-    .as_u32 = clib_host_to_net_u32 (0x06000105),
+    .as_u32 = clib_host_to_net_u32 (0x07000105),
   };
 
   intf_sep.ip.ip4 = intf_addr;
@@ -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,
@@ -1376,7 +1376,7 @@ session_test_proxy (vlib_main_t * vm, unformat_input_t * input)
   char *show_listeners = "sh session listeners tcp verbose";
   char *show_local_listeners = "sh app ns table default";
   unformat_input_t tmp_input;
-  u32 server_index, app_index, server_wrk_index;
+  u32 server_index, app_index;
   u32 dummy_server_api_index = ~0, sw_if_index = 0;
   clib_error_t *error = 0;
   u8 is_filtered = 0;
@@ -1384,7 +1384,6 @@ session_test_proxy (vlib_main_t * vm, unformat_input_t * input)
   transport_connection_t *tc;
   u16 lcl_port = 1234, rmt_port = 4321;
   app_namespace_t *app_ns;
-  application_t *server;
   int verbose = 0;
 
   while (unformat_check_input (input) != UNFORMAT_END_OF_INPUT)
@@ -1425,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;
@@ -1444,8 +1443,6 @@ session_test_proxy (vlib_main_t * vm, unformat_input_t * input)
   error = vnet_application_attach (&attach_args);
   SESSION_TEST ((error == 0), "server attachment should work");
   server_index = attach_args.app_index;
-  server = application_get (server_index);
-  server_wrk_index = application_get_default_worker (server)->wrk_index;
 
   if (verbose)
     {
@@ -1462,7 +1459,7 @@ session_test_proxy (vlib_main_t * vm, unformat_input_t * input)
   SESSION_TEST ((tc != 0), "lookup 1.2.3.4 1234 5.6.7.8 4321 should be "
                "successful");
   s = listen_session_get (tc->s_index);
-  SESSION_TEST ((s->app_wrk_index == server_wrk_index), "lookup should return"
+  SESSION_TEST ((s->app_index == server_index), "lookup should return"
                " the server");
 
   tc = session_lookup_connection_wt4 (0, &rmt_ip, &rmt_ip, lcl_port, rmt_port,