|
|
|
@ -1258,10 +1258,9 @@ int SigMatchSignatures(ThreadVars *th_v, DetectEngineCtx *de_ctx, DetectEngineTh
|
|
|
|
SigMatch *sm = NULL;
|
|
|
|
SigMatch *sm = NULL;
|
|
|
|
uint16_t alversion = 0;
|
|
|
|
uint16_t alversion = 0;
|
|
|
|
int reset_de_state = 0;
|
|
|
|
int reset_de_state = 0;
|
|
|
|
AppLayerDecoderEvents *app_decoder_events = NULL;
|
|
|
|
|
|
|
|
int app_decoder_events_cnt = 0;
|
|
|
|
|
|
|
|
int alerts = 0;
|
|
|
|
int alerts = 0;
|
|
|
|
int i;
|
|
|
|
int i;
|
|
|
|
|
|
|
|
int app_decoder_events = 0;
|
|
|
|
|
|
|
|
|
|
|
|
SCEnter();
|
|
|
|
SCEnter();
|
|
|
|
|
|
|
|
|
|
|
|
@ -1346,9 +1345,7 @@ int SigMatchSignatures(ThreadVars *th_v, DetectEngineCtx *de_ctx, DetectEngineTh
|
|
|
|
SCLogDebug("packet doesn't have established flag set (proto %d)", p->proto);
|
|
|
|
SCLogDebug("packet doesn't have established flag set (proto %d)", p->proto);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
app_decoder_events = AppLayerGetDecoderEventsForFlow(p->flow);
|
|
|
|
app_decoder_events = AppLayerFlowHasDecoderEvents(p->flow, flags);
|
|
|
|
if (app_decoder_events != NULL)
|
|
|
|
|
|
|
|
app_decoder_events_cnt = app_decoder_events->cnt;
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
FLOWLOCK_UNLOCK(p->flow);
|
|
|
|
FLOWLOCK_UNLOCK(p->flow);
|
|
|
|
|
|
|
|
|
|
|
|
@ -1447,7 +1444,7 @@ int SigMatchSignatures(ThreadVars *th_v, DetectEngineCtx *de_ctx, DetectEngineTh
|
|
|
|
|
|
|
|
|
|
|
|
/* create our prefilter mask */
|
|
|
|
/* create our prefilter mask */
|
|
|
|
SignatureMask mask = 0;
|
|
|
|
SignatureMask mask = 0;
|
|
|
|
PacketCreateMask(p, &mask, alproto, alstate, smsg, app_decoder_events_cnt);
|
|
|
|
PacketCreateMask(p, &mask, alproto, alstate, smsg, app_decoder_events);
|
|
|
|
|
|
|
|
|
|
|
|
/* run the mpm for each type */
|
|
|
|
/* run the mpm for each type */
|
|
|
|
PACKET_PROFILING_DETECT_START(p, PROF_DETECT_MPM);
|
|
|
|
PACKET_PROFILING_DETECT_START(p, PROF_DETECT_MPM);
|
|
|
|
@ -2184,7 +2181,7 @@ deonly:
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
static void
|
|
|
|
static void
|
|
|
|
PacketCreateMask(Packet *p, SignatureMask *mask, uint16_t alproto, void *alstate, StreamMsg *smsg,
|
|
|
|
PacketCreateMask(Packet *p, SignatureMask *mask, uint16_t alproto, void *alstate, StreamMsg *smsg,
|
|
|
|
int app_decoder_events_cnt)
|
|
|
|
int app_decoder_events)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
if (!(p->flags & PKT_NOPAYLOAD_INSPECTION) && (p->payload_len > 0 || smsg != NULL)) {
|
|
|
|
if (!(p->flags & PKT_NOPAYLOAD_INSPECTION) && (p->payload_len > 0 || smsg != NULL)) {
|
|
|
|
SCLogDebug("packet has payload");
|
|
|
|
SCLogDebug("packet has payload");
|
|
|
|
@ -2194,7 +2191,7 @@ PacketCreateMask(Packet *p, SignatureMask *mask, uint16_t alproto, void *alstate
|
|
|
|
(*mask) |= SIG_MASK_REQUIRE_NO_PAYLOAD;
|
|
|
|
(*mask) |= SIG_MASK_REQUIRE_NO_PAYLOAD;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (p->events.cnt > 0 || app_decoder_events_cnt > 0) {
|
|
|
|
if (p->events.cnt > 0 || app_decoder_events != 0) {
|
|
|
|
SCLogDebug("packet/flow has events set");
|
|
|
|
SCLogDebug("packet/flow has events set");
|
|
|
|
(*mask) |= SIG_MASK_REQUIRE_ENGINE_EVENT;
|
|
|
|
(*mask) |= SIG_MASK_REQUIRE_ENGINE_EVENT;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|