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
2 changes: 1 addition & 1 deletion src/detect.c
Original file line number Diff line number Diff line change
Expand Up @@ -2270,7 +2270,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
13 changes: 8 additions & 5 deletions src/stream-tcp.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* Copyright (C) 2007-2025 Open Information Security Foundation
/* Copyright (C) 2007-2026 Open Information Security Foundation
*
* You can copy, redistribute or modify this Program under the terms of
* the GNU General Public License version 2 as published by the Free
Expand Down Expand Up @@ -5731,6 +5731,7 @@ int StreamTcpPacket (ThreadVars *tv, Packet *p, StreamTcpThread *stt,
if (StreamTcpPacketStateNone(tv, p, stt, ssn) == -1) {
goto error;
}
ssn = (TcpSession *)p->flow->protoctx;

if (ssn != NULL)
SCLogDebug("ssn->alproto %"PRIu16"", p->flow->alproto);
Expand Down Expand Up @@ -5804,17 +5805,19 @@ int StreamTcpPacket (ThreadVars *tv, Packet *p, StreamTcpThread *stt,

skip:
StreamTcpPacketCheckPostRst(ssn, p);

if (ssn->state >= TCP_ESTABLISHED) {
p->flags |= PKT_STREAM_EST;
}
Comment on lines -5807 to -5810
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this change go in a separate commit?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah I think that is cleaner.

}

if (ssn != NULL) {
/* recalc the csum on the packet if it was modified */
if (p->flags & PKT_STREAM_MODIFIED) {
ReCalculateChecksum(p);
}

/* if ssn was set in this run (e.g. midstream cases), reflect TCP state on the packet */
if (ssn->state >= TCP_ESTABLISHED) {
p->flags |= PKT_STREAM_EST;
}

/* check for conditions that may make us not want to log this packet */

/* streams that hit depth */
Expand Down
Loading