vrrp: fix vrrp_garp_or_na_send()'s memory leak
[vpp.git] / src / plugins / ct6 / ct6_in2out.c
index 2e151f7..c5d26c8 100644 (file)
@@ -16,7 +16,6 @@
  */
 #include <vlib/vlib.h>
 #include <vnet/vnet.h>
-#include <vnet/pg/pg.h>
 #include <vppinfra/error.h>
 #include <ct6/ct6.h>
 
@@ -90,11 +89,11 @@ ct6_create_or_recycle_session (ct6_main_t * cmp,
   s0 = pool_elt_at_index (cmp->sessions[my_thread_index],
                          cmp->last_index[my_thread_index]);
 
-  if (s0->expires < now)
+  if (CLIB_DEBUG > 0 && s0->expires < now)
     clib_warning ("session %d expired %.2f time now %.2f",
                  s0 - cmp->sessions[my_thread_index], s0->expires, now);
 
-  if (pool_elts (cmp->sessions[my_thread_index]) >=
+  if (CLIB_DEBUG > 0 && pool_elts (cmp->sessions[my_thread_index]) >=
       cmp->max_sessions_per_worker)
     clib_warning ("recycle session %d have %d max %d",
                  s0 - cmp->sessions[my_thread_index],
@@ -166,10 +165,10 @@ ct6_in2out_inline (vlib_main_t * vm,
          vlib_prefetch_buffer_header (b[5], STORE);
          vlib_prefetch_buffer_header (b[6], STORE);
          vlib_prefetch_buffer_header (b[7], STORE);
-         CLIB_PREFETCH (b[4]->data, CLIB_CACHE_LINE_BYTES, STORE);
-         CLIB_PREFETCH (b[5]->data, CLIB_CACHE_LINE_BYTES, STORE);
-         CLIB_PREFETCH (b[6]->data, CLIB_CACHE_LINE_BYTES, STORE);
-         CLIB_PREFETCH (b[7]->data, CLIB_CACHE_LINE_BYTES, STORE);
+         clib_prefetch_store (b[4]->data);
+         clib_prefetch_store (b[5]->data);
+         clib_prefetch_store (b[6]->data);
+         clib_prefetch_store (b[7]->data);
        }
 
       /* $$$$ process 4x pkts right here */
@@ -267,7 +266,7 @@ ct6_in2out_inline (vlib_main_t * vm,
        */
       if (PREDICT_FALSE (!ip6_address_is_global_unicast (&ip0->src_address)
                         ||
-                        !ip6_address_is_global_unicast (&ip0->src_address)))
+                        !ip6_address_is_global_unicast (&ip0->dst_address)))
        goto trace0;
       /* Pass non-udp, non-tcp traffic */
       if (PREDICT_FALSE (ip0->protocol != IP_PROTOCOL_TCP &&
@@ -345,7 +344,6 @@ VLIB_NODE_FN (ct6_in2out_node) (vlib_main_t * vm, vlib_node_runtime_t * node,
     return ct6_in2out_inline (vm, node, frame, 0 /* is_trace */ );
 }
 
-/* *INDENT-OFF* */
 #ifndef CLIB_MARCH_VARIANT
 VLIB_REGISTER_NODE (ct6_in2out_node) =
 {
@@ -366,7 +364,6 @@ VLIB_REGISTER_NODE (ct6_in2out_node) =
   .unformat_buffer = unformat_ethernet_header,
 };
 #endif /* CLIB_MARCH_VARIANT */
-/* *INDENT-ON* */
 
 /*
  * fd.io coding-style-patch-verification: ON