/* flow is still locked */
if (f->proto == IPPROTO_TCP && !(f->flags & FLOW_TIMEOUT_REASSEMBLY_DONE) &&
-#ifdef CAPTURE_OFFLOAD
- f->flow_state != FLOW_STATE_CAPTURE_BYPASSED &&
-#endif
- f->flow_state != FLOW_STATE_LOCAL_BYPASSED &&
- FlowForceReassemblyNeedReassembly(f) == 1) {
+ !FlowIsBypassed(f) && FlowForceReassemblyNeedReassembly(f) == 1) {
/* Send the flow to its thread */
FlowForceReassemblyForFlow(f);
FLOWLOCK_UNLOCK(f);
FLOWLOCK_WRLOCK(f);
f->flow_end_flags |= FLOW_END_FLAG_TIMEOUT; //TODO emerg
- const FlowStateType state = f->flow_state;
if (f->proto == IPPROTO_TCP) {
- if (!(f->flags & FLOW_TIMEOUT_REASSEMBLY_DONE) &&
-#ifdef CAPTURE_OFFLOAD
- state != FLOW_STATE_CAPTURE_BYPASSED &&
-#endif
- state != FLOW_STATE_LOCAL_BYPASSED &&
- FlowForceReassemblyNeedReassembly(f) == 1 &&
- f->ffr != 0)
- {
+ if (!(f->flags & FLOW_TIMEOUT_REASSEMBLY_DONE) && !FlowIsBypassed(f) &&
+ FlowForceReassemblyNeedReassembly(f) == 1 && f->ffr != 0) {
int cnt = FlowFinish(tv, f, fw, detect_thread);
counters->flows_aside_pkt_inject += cnt;
counters->flows_aside_needs_work++;
#endif
}
+static inline bool FlowIsBypassed(const Flow *f)
+{
+ if (
+#ifdef CAPTURE_OFFLOAD
+ f->flow_state == FLOW_STATE_CAPTURE_BYPASSED ||
+#endif
+ f->flow_state == FLOW_STATE_LOCAL_BYPASSED) {
+ return true;
+ }
+ return false;
+}
+
int FlowClearMemory(Flow *,uint8_t );
AppProto FlowGetAppProtocol(const Flow *f);