c11 safe string handling support
[vpp.git] / src / vnet / l2tp / l2tp.c
index 2d32339..99ae6c4 100644 (file)
@@ -157,7 +157,7 @@ test_counters_command_fn (vlib_main_t * vm,
   u32 session_index;
   u32 counter_index;
   u32 nincr = 0;
-  u32 cpu_index = os_get_cpu_number ();
+  u32 thread_index = vm->thread_index;
 
   /* *INDENT-OFF* */
   pool_foreach (session, lm->sessions,
@@ -167,11 +167,11 @@ test_counters_command_fn (vlib_main_t * vm,
       session_index_to_counter_index (session_index,
                                       SESSION_COUNTER_USER_TO_NETWORK);
     vlib_increment_combined_counter (&lm->counter_main,
-                                     cpu_index,
+                                     thread_index,
                                      counter_index,
                                      1/*pkt*/, 1111 /*bytes*/);
     vlib_increment_combined_counter (&lm->counter_main,
-                                     cpu_index,
+                                     thread_index,
                                      counter_index+1,
                                      1/*pkt*/, 2222 /*bytes*/);
     nincr++;
@@ -334,7 +334,7 @@ create_l2tpv3_ipv6_tunnel (l2t_main_t * lm,
     return VNET_API_ERROR_INVALID_VALUE;
 
   pool_get (lm->sessions, s);
-  memset (s, 0, sizeof (*s));
+  clib_memset (s, 0, sizeof (*s));
   clib_memcpy (&s->our_address, our_address, sizeof (s->our_address));
   clib_memcpy (&s->client_address, client_address,
               sizeof (s->client_address));
@@ -626,7 +626,7 @@ l2tpv3_interface_enable_disable (vnet_main_t * vnm,
   return 0;
 }
 
-/* Enable/disable L2TPv3 intercept on IP6 fowarding path */
+/* Enable/disable L2TPv3 intercept on IP6 forwarding path */
 static clib_error_t *
 set_ip6_l2tpv3 (vlib_main_t * vm,
                unformat_input_t * input, vlib_cli_command_t * cmd)
@@ -747,6 +747,16 @@ l2tp_init (vlib_main_t * vm)
 
 VLIB_INIT_FUNCTION (l2tp_init);
 
+clib_error_t *
+l2tp_worker_init (vlib_main_t * vm)
+{
+  l2tp_encap_init (vm);
+
+  return 0;
+}
+
+VLIB_WORKER_INIT_FUNCTION (l2tp_worker_init);
+
 /*
  * fd.io coding-style-patch-verification: ON
  *