eve/flow: log tcp reuse as 'reason'

Ticket: #7482.
pull/12371/head
Victor Julien 6 months ago committed by Victor Julien
parent aab50e8ad0
commit bc374b8e40

@ -768,6 +768,7 @@ static Flow *TcpReuseReplace(ThreadVars *tv, FlowLookupStruct *fls, FlowBucket *
old_f->timeout_at = 0;
/* get some settings that we move over to the new flow */
FlowThreadId thread_id[2] = { old_f->thread_id[0], old_f->thread_id[1] };
old_f->flow_end_flags |= FLOW_END_FLAG_TCPREUSE;
/* flow is unlocked by caller */

@ -244,6 +244,7 @@ typedef struct AppLayerParserState_ AppLayerParserState;
#define FLOW_END_FLAG_TIMEOUT 0x02
#define FLOW_END_FLAG_FORCED 0x04
#define FLOW_END_FLAG_SHUTDOWN 0x08
#define FLOW_END_FLAG_TCPREUSE 0x10
/** Mutex or RWLocks for the flow. */
//#define FLOWLOCK_RWLOCK

@ -258,7 +258,9 @@ static void EveFlowLogJSON(OutputJsonThreadCtx *aft, JsonBuilder *jb, Flow *f)
}
const char *reason = NULL;
if (f->flow_end_flags & FLOW_END_FLAG_FORCED)
if (f->flow_end_flags & FLOW_END_FLAG_TCPREUSE)
reason = "tcp_reuse";
else if (f->flow_end_flags & FLOW_END_FLAG_FORCED)
reason = "forced";
else if (f->flow_end_flags & FLOW_END_FLAG_SHUTDOWN)
reason = "shutdown";

Loading…
Cancel
Save