| 
						
						
							
								
							
						
						
					 | 
					 | 
					@ -123,27 +123,23 @@ static int DeStateSearchState(DetectEngineState *state, uint8_t direction, SigIn
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					static void DeStateSignatureAppend(DetectEngineState *state,
 | 
					 | 
					 | 
					 | 
					static void DeStateSignatureAppend(DetectEngineState *state,
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					        const Signature *s, uint32_t inspect_flags, uint8_t direction)
 | 
					 | 
					 | 
					 | 
					        const Signature *s, uint32_t inspect_flags, uint8_t direction)
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					{
 | 
					 | 
					 | 
					 | 
					{
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    int jump = 0;
 | 
					 | 
					 | 
					 | 
					    SCEnter();
 | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    int i = 0;
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
				
				
			
		
	
		
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    DetectEngineStateDirection *dir_state = &state->dir_state[direction & STREAM_TOSERVER ? 0 : 1];
 | 
					 | 
					 | 
					 | 
					    DetectEngineStateDirection *dir_state = &state->dir_state[direction & STREAM_TOSERVER ? 0 : 1];
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					#ifdef DEBUG_VALIDATION
 | 
					 | 
					 | 
					 | 
					#ifdef DEBUG_VALIDATION
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    BUG_ON(DeStateSearchState(state, direction, s->num));
 | 
					 | 
					 | 
					 | 
					    BUG_ON(DeStateSearchState(state, direction, s->num));
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					#endif
 | 
					 | 
					 | 
					 | 
					#endif
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    DeStateStore *store = dir_state->head;
 | 
					 | 
					 | 
					 | 
					    DeStateStore *store = dir_state->tail;
 | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    if (store == NULL) {
 | 
					 | 
					 | 
					 | 
					    if (store == NULL) {
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					        store = DeStateStoreAlloc();
 | 
					 | 
					 | 
					 | 
					        store = DeStateStoreAlloc();
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					        if (store != NULL) {
 | 
					 | 
					 | 
					 | 
					        dir_state->head = store;
 | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					            dir_state->head = store;
 | 
					 | 
					 | 
					 | 
					        dir_state->tail = store;
 | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					            dir_state->tail = store;
 | 
					 | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					        }
 | 
					 | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    } else {
 | 
					 | 
					 | 
					 | 
					    } else {
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					        jump = dir_state->cnt / DE_STATE_CHUNK_SIZE;
 | 
					 | 
					 | 
					 | 
					        SCLogDebug("dir_state->cnt %u mod chunksize %u", dir_state->cnt,
 | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					        for (i = 0; i < jump; i++) {
 | 
					 | 
					 | 
					 | 
					                dir_state->cnt % DE_STATE_CHUNK_SIZE);
 | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					            store = store->next;
 | 
					 | 
					 | 
					 | 
					        if (dir_state->cnt && dir_state->cnt % DE_STATE_CHUNK_SIZE == 0) {
 | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					        }
 | 
					 | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					        if (store == NULL) {
 | 
					 | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
	
		
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					            store = DeStateStoreAlloc();
 | 
					 | 
					 | 
					 | 
					            store = DeStateStoreAlloc();
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					            if (store != NULL) {
 | 
					 | 
					 | 
					 | 
					            if (store != NULL) {
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					                dir_state->tail->next = store;
 | 
					 | 
					 | 
					 | 
					                dir_state->tail->next = store;
 | 
				
			
			
		
	
	
		
		
			
				
					| 
						
						
						
							
								
							
						
					 | 
					 | 
					@ -151,15 +147,14 @@ static void DeStateSignatureAppend(DetectEngineState *state,
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					            }
 | 
					 | 
					 | 
					 | 
					            }
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					        }
 | 
					 | 
					 | 
					 | 
					        }
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    }
 | 
					 | 
					 | 
					 | 
					    }
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    if (store == NULL)
 | 
					 | 
					 | 
					 | 
					    if (store == NULL)
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					        return;
 | 
					 | 
					 | 
					 | 
					        SCReturn;
 | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    SigIntId idx = dir_state->cnt++ % DE_STATE_CHUNK_SIZE;
 | 
					 | 
					 | 
					 | 
					    SigIntId idx = dir_state->cnt++ % DE_STATE_CHUNK_SIZE;
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    store->store[idx].sid = s->num;
 | 
					 | 
					 | 
					 | 
					    store->store[idx].sid = s->num;
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    store->store[idx].flags = inspect_flags;
 | 
					 | 
					 | 
					 | 
					    store->store[idx].flags = inspect_flags;
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    return;
 | 
					 | 
					 | 
					 | 
					    SCReturn;
 | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					}
 | 
					 | 
					 | 
					 | 
					}
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					DetectEngineState *DetectEngineStateAlloc(void)
 | 
					 | 
					 | 
					 | 
					DetectEngineState *DetectEngineStateAlloc(void)
 | 
				
			
			
		
	
	
		
		
			
				
					| 
						
							
								
							
						
						
						
					 | 
					 | 
					
 
 |