nat: refactor & MW support for NAT tests
[vpp.git] / src / plugins / nat / nat.c
index e02a11a..eeaa443 100644 (file)
@@ -4388,16 +4388,13 @@ nat44_sessions_clear ()
   /* *INDENT-OFF* */
   vec_foreach (tsm, sm->per_thread_data)
     {
-      u32 ti;
-
       nat44_db_free (tsm);
       nat44_db_init (tsm);
-
-      ti = tsm->snat_thread_index;
-      vlib_set_simple_counter (&sm->total_users, ti, 0, 0);
-      vlib_set_simple_counter (&sm->total_sessions, ti, 0, 0);
     }
   /* *INDENT-ON* */
+
+  vlib_zero_simple_counter (&sm->total_users, 0);
+  vlib_zero_simple_counter (&sm->total_sessions, 0);
 }
 
 static void