misc: fix icmp
[vpp.git] / src / vnet / ip / icmp6.c
index f92f31c..184fce6 100644 (file)
@@ -127,12 +127,6 @@ format_icmp6_input_trace (u8 * s, va_list * va)
   return s;
 }
 
-static char *icmp_error_strings[] = {
-#define _(f,s) s,
-  foreach_icmp6_error
-#undef _
-};
-
 typedef enum
 {
   ICMP_INPUT_NEXT_PUNT,
@@ -250,8 +244,8 @@ VLIB_REGISTER_NODE (ip6_icmp_input_node) = {
 
   .format_trace = format_icmp6_input_trace,
 
-  .n_errors = ARRAY_LEN (icmp_error_strings),
-  .error_strings = icmp_error_strings,
+  .n_errors = ICMP6_N_ERROR,
+  .error_counters = icmp6_error_counters,
 
   .n_next_nodes = 1,
   .next_nodes = {
@@ -372,7 +366,6 @@ ip6_icmp_error (vlib_main_t * vm,
                               -(sizeof (ip6_header_t) +
                                 sizeof (icmp46_header_t) + 4));
 
-         vnet_buffer (p0)->sw_if_index[VLIB_TX] = ~0;
          p0->flags |= VNET_BUFFER_F_LOCALLY_ORIGINATED;
          p0->current_length =
            p0->current_length > 1280 ? 1280 : p0->current_length;
@@ -439,8 +432,8 @@ VLIB_REGISTER_NODE (ip6_icmp_error_node) = {
   .name = "ip6-icmp-error",
   .vector_size = sizeof (u32),
 
-  .n_errors = ARRAY_LEN (icmp_error_strings),
-  .error_strings = icmp_error_strings,
+  .n_errors = ICMP6_N_ERROR,
+  .error_counters = icmp6_error_counters,
 
   .n_next_nodes = IP6_ICMP_ERROR_N_NEXT,
   .next_nodes = {
@@ -650,7 +643,7 @@ icmp6_init (vlib_main_t * vm)
   vlib_thread_main_t *tm = &vlib_thread_main;
   u32 n_vlib_mains = tm->n_vlib_mains;
 
-  throttle_init (&icmp_throttle, n_vlib_mains, 1e-3);
+  throttle_init (&icmp_throttle, n_vlib_mains, THROTTLE_BITS, 1e-3);
 
   return (NULL);
 }