Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 17 additions & 4 deletions src/detect-engine-build.c
Original file line number Diff line number Diff line change
Expand Up @@ -1724,6 +1724,8 @@ int SigPrepareStage1(DetectEngineCtx *de_ctx)
{
uint32_t cnt_iponly = 0;
uint32_t cnt_payload = 0;
uint32_t cnt_packet = 0;
uint32_t cnt_packet_stream = 0;
uint32_t cnt_applayer = 0;
uint32_t cnt_deonly = 0;

Expand Down Expand Up @@ -1752,6 +1754,12 @@ int SigPrepareStage1(DetectEngineCtx *de_ctx)
} else if (SignatureIsInspectingPayload(de_ctx, s) == 1) {
SCLogDebug("Signature %"PRIu32" is considered \"Payload inspecting\"", s->id);
cnt_payload++;
} else if (s->type == SIG_TYPE_PKT) {
SCLogDebug("Signature %" PRIu32 " is considered \"Packet inspecting\"", s->id);
cnt_packet++;
} else if (s->type == SIG_TYPE_PKT_STREAM) {
SCLogDebug("Signature %" PRIu32 " is considered \"Packet-stream inspecting\"", s->id);
cnt_packet_stream++;
} else if (s->type == SIG_TYPE_DEONLY) {
SCLogDebug("Signature %"PRIu32" is considered \"Decoder Event only\"", s->id);
cnt_deonly++;
Expand Down Expand Up @@ -1812,14 +1820,19 @@ int SigPrepareStage1(DetectEngineCtx *de_ctx)
if (strlen(de_ctx->config_prefix) > 0)
SCLogInfo("tenant id %d: %" PRIu32 " signatures processed. %" PRIu32 " are IP-only "
"rules, %" PRIu32 " are inspecting packet payload, %" PRIu32
" inspect application layer, %" PRIu32 " are decoder event only",
" inspect application layer, %" PRIu32 " are decoder event only, %" PRIu32
" are packet inspecting,"
" %" PRIu32 " are packet-stream inspecting",
de_ctx->tenant_id, de_ctx->sig_cnt, cnt_iponly, cnt_payload, cnt_applayer,
cnt_deonly);
cnt_deonly, cnt_packet, cnt_packet_stream);
else
SCLogInfo("%" PRIu32 " signatures processed. %" PRIu32 " are IP-only "
"rules, %" PRIu32 " are inspecting packet payload, %" PRIu32
" inspect application layer, %" PRIu32 " are decoder event only",
de_ctx->sig_cnt, cnt_iponly, cnt_payload, cnt_applayer, cnt_deonly);
" inspect application layer, %" PRIu32 " are decoder event only %" PRIu32
" are packet inspecting,"
" %" PRIu32 " are packet-stream inspecting",
de_ctx->sig_cnt, cnt_iponly, cnt_payload, cnt_applayer, cnt_deonly, cnt_packet,
cnt_packet_stream);

SCLogConfig("building signature grouping structure, stage 1: "
"preprocessing rules... complete");
Expand Down
4 changes: 2 additions & 2 deletions src/detect.c
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ static void DetectRun(ThreadVars *th_v,
/* run tx/state inspection. Don't call for ICMP error msgs. */
if (pflow && pflow->alstate && likely(pflow->proto == p->proto)) {
if (p->proto == IPPROTO_TCP) {
if ((p->flags & PKT_STREAM_EST) == 0) {
if ((p->flags & PKT_STREAM_EST) == 0 && !stream_config.midstream) {
SCLogDebug("packet %" PRIu64 ": skip tcp non-established", p->pcap_cnt);
DetectRunAppendDefaultAccept(det_ctx, p);
goto end;
Expand Down Expand Up @@ -2269,7 +2269,7 @@ static void DetectFlow(ThreadVars *tv,
skip = (p->flags & PKT_NOPACKET_INSPECTION || f->flags & (FLOW_ACTION_PASS));
}
if (skip) {
/* enfore prior accept:flow */
/* enforce prior accept:flow */
if (f->flags & FLOW_ACTION_ACCEPT) {
p->action |= ACTION_ACCEPT;
}
Expand Down
Loading