@ -5519,20 +5519,20 @@ static inline int StreamTcpStateDispatch(
return 0 ;
return 0 ;
}
}
static inline void Handle ThreadId( ThreadVars * tv , Packet * p , StreamTcpThread * stt )
static inline void Check ThreadId( ThreadVars * tv , Packet * p , StreamTcpThread * stt )
{
{
const int idx = ( ! ( PKT_IS_TOSERVER ( p ) ) ) ;
const int idx = ( ! ( PKT_IS_TOSERVER ( p ) ) ) ;
/* assign the thread id to the flow */
/* assign the thread id to the flow */
if ( un likely( p - > flow - > thread_id [ idx ] = = 0 ) ) {
if ( likely( p - > flow - > thread_id [ idx ] ! = 0 ) ) {
p - > flow - > thread_id [ idx ] = ( FlowThreadId ) tv - > id ;
if ( unlikely ( ( FlowThreadId ) tv - > id ! = p - > flow - > thread_id [ idx ] ) ) {
} else if ( unlikely ( ( FlowThreadId ) tv - > id ! = p - > flow - > thread_id [ idx ] )) {
SCLogDebug ( " wrong thread: flow has %u, we are %d " , p - > flow - > thread_id [ idx ] , tv - > id ) ;
SCLogDebug ( " wrong thread: flow has %u, we are %d " , p - > flow - > thread_id [ idx ] , tv - > id ) ;
if ( p - > pkt_src = = PKT_SRC_WIRE ) {
if ( p - > pkt_src = = PKT_SRC_WIRE ) {
StatsIncr ( tv , stt - > counter_tcp_wrong_thread ) ;
StatsIncr ( tv , stt - > counter_tcp_wrong_thread ) ;
if ( ( p - > flow - > flags & FLOW_WRONG_THREAD ) = = 0 ) {
if ( ( p - > flow - > flags & FLOW_WRONG_THREAD ) = = 0 ) {
p - > flow - > flags | = FLOW_WRONG_THREAD ;
p - > flow - > flags | = FLOW_WRONG_THREAD ;
StreamTcpSetEvent ( p , STREAM_WRONG_THREAD ) ;
StreamTcpSetEvent ( p , STREAM_WRONG_THREAD ) ;
}
}
}
}
}
}
}
@ -5959,7 +5959,7 @@ TmEcode StreamTcp (ThreadVars *tv, Packet *p, void *data, PacketQueueNoLock *pq)
return TM_ECODE_OK ;
return TM_ECODE_OK ;
}
}
Handle ThreadId( tv , p , stt ) ;
Check ThreadId( tv , p , stt ) ;
/* only TCP packets with a flow from here */
/* only TCP packets with a flow from here */