ip: reassembly: don't set error if no error
[vpp.git] / src / vnet / ip / reass / ip6_full_reass.c
index aaaf56a..ff3475a 100644 (file)
@@ -1092,6 +1092,9 @@ ip6_full_reassembly_inline (vlib_main_t * vm,
              next0 = IP6_FULL_REASSEMBLY_NEXT_INPUT;
              goto skip_reass;
            }
+         vnet_buffer (b0)->ip.reass.ip6_frag_hdr_offset =
+           (u8 *) frag_hdr - (u8 *) ip0;
+
          if (0 == ip6_frag_hdr_offset (frag_hdr))
            {
              // first fragment - verify upper-layer is present
@@ -1110,9 +1113,6 @@ ip6_full_reassembly_inline (vlib_main_t * vm,
              next0 = IP6_FULL_REASSEMBLY_NEXT_ICMP_ERROR;
              goto skip_reass;
            }
-         vnet_buffer (b0)->ip.reass.ip6_frag_hdr_offset =
-           (u8 *) frag_hdr - (u8 *) ip0;
-
          ip6_full_reass_kv_t kv;
          u8 do_handoff = 0;
 
@@ -1199,14 +1199,20 @@ ip6_full_reassembly_inline (vlib_main_t * vm,
              error0 = IP6_ERROR_REASS_LIMIT_REACHED;
            }
 
-         b0->error = node->errors[error0];
-
          if (~0 != bi0)
            {
            skip_reass:
              to_next[0] = bi0;
              to_next += 1;
              n_left_to_next -= 1;
+
+             /* bi0 might have been updated by reass_finalize, reload */
+             b0 = vlib_get_buffer (vm, bi0);
+             if (IP6_ERROR_NONE != error0)
+               {
+                 b0->error = node->errors[error0];
+               }
+
              if (next0 == IP6_FULL_REASSEMBLY_NEXT_HANDOFF)
                {
                  if (PREDICT_FALSE (b0->flags & VLIB_BUFFER_IS_TRACED))
@@ -1219,7 +1225,6 @@ ip6_full_reassembly_inline (vlib_main_t * vm,
                }
              else if (is_feature && IP6_ERROR_NONE == error0)
                {
-                 b0 = vlib_get_buffer (vm, bi0);
                  vnet_feature_next (&next0, b0);
                }
              vlib_validate_buffer_enqueue_x1 (vm, node, next_index, to_next,
@@ -1347,7 +1352,7 @@ typedef struct
   clib_bihash_48_8_t *new_hash;
 } ip6_rehash_cb_ctx;
 
-static void
+static int
 ip6_rehash_cb (clib_bihash_kv_48_8_t * kv, void *_ctx)
 {
   ip6_rehash_cb_ctx *ctx = _ctx;
@@ -1355,6 +1360,7 @@ ip6_rehash_cb (clib_bihash_kv_48_8_t * kv, void *_ctx)
     {
       ctx->failure = 1;
     }
+  return (BIHASH_WALK_CONTINUE);
 }
 
 static void
@@ -1671,8 +1677,15 @@ show_ip6_full_reass (vlib_main_t * vm, unformat_input_t * input,
   vlib_cli_output (vm, "---------------------");
   vlib_cli_output (vm, "Current IP6 reassemblies count: %lu\n",
                   (long unsigned) sum_reass_n);
-  vlib_cli_output (vm, "Maximum configured concurrent IP6 reassemblies per "
-                  "worker-thread: %lu\n", (long unsigned) rm->max_reass_n);
+  vlib_cli_output (vm,
+                  "Maximum configured concurrent full IP6 reassemblies per worker-thread: %lu\n",
+                  (long unsigned) rm->max_reass_n);
+  vlib_cli_output (vm,
+                  "Maximum configured full IP6 reassembly timeout: %lums\n",
+                  (long unsigned) rm->timeout_ms);
+  vlib_cli_output (vm,
+                  "Maximum configured full IP6 reassembly expire walk interval: %lums\n",
+                  (long unsigned) rm->expire_walk_interval_ms);
   vlib_cli_output (vm, "Buffers in use: %lu\n",
                   (long unsigned) sum_buffers_n);
   return 0;