SC_ATOMIC_EXTERN(unsigned int, flow_flags);
static Flow *FlowGetUsedFlow(ThreadVars *tv, DecodeThreadVars *dtv);
+static int handle_tcp_reuse = 1;
#ifdef FLOW_DEBUG_STATS
#define FLOW_DEBUG_STATS_PROTO_ALL 0
#endif /* FLOW_DEBUG_STATS */
+void FlowDisableTcpReuseHandling(void)
+{
+ handle_tcp_reuse = 0;
+}
+
/** \brief compare two raw ipv6 addrs
*
* \note we don't care about the real ipv6 ip's, this is just
if (f->flags & FLOW_TCP_REUSED)
return 0;
- /* lets see if we need to consider the existing session reuse */
- if (unlikely(TcpSessionPacketSsnReuse(p, f, f->protoctx) == 1)) {
- /* okay, we need to setup a new flow for this packet.
- * Flag the flow that it's been replaced by a new one */
- f->flags |= FLOW_TCP_REUSED;
- SCLogDebug("flow obsolete: TCP reuse will use a new flow "
- "starting with packet %"PRIu64, p->pcap_cnt);
- return 0;
+ if (handle_tcp_reuse == 1) {
+ /* lets see if we need to consider the existing session reuse */
+ if (unlikely(TcpSessionPacketSsnReuse(p, f, f->protoctx) == 1)) {
+ /* okay, we need to setup a new flow for this packet.
+ * Flag the flow that it's been replaced by a new one */
+ f->flags |= FLOW_TCP_REUSED;
+ SCLogDebug("flow obsolete: TCP reuse will use a new flow "
+ "starting with packet %"PRIu64, p->pcap_cnt);
+ return 0;
+ }
}
return 1;
} else {
Flow *FlowGetFlowFromHash(ThreadVars *tv, DecodeThreadVars *dtv, const Packet *);
+void FlowDisableTcpReuseHandling(void);
+
/** enable to print stats on hash lookups in flow-debug.log */
//#define FLOW_DEBUG_STATS
#include "util-runmodes.h"
+#include "flow-hash.h"
+
/** set to true if flow engine and stream engine run in different
* threads. */
static int runmode_flow_stream_async = 0;
void RunmodeSetFlowStreamAsync(void)
{
runmode_flow_stream_async = 1;
+ FlowDisableTcpReuseHandling();
}
int RunmodeGetFlowStreamAsync(void)