From 72a147b6f16ded148fc65428b98f0be9a0986691 Mon Sep 17 00:00:00 2001 From: Victor Julien Date: Wed, 13 Nov 2013 18:18:19 +0100 Subject: [PATCH] detect: only inspect smsg for valid tcp packets Packets that are rejected by the stream engine are not considered part of an established tcp session. By allowing them to inspect an smsg, some smsgs would not be properly inspected. --- src/detect.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/detect.c b/src/detect.c index 44e9b72816..24457f8b77 100644 --- a/src/detect.c +++ b/src/detect.c @@ -706,7 +706,7 @@ static StreamMsg *SigMatchSignaturesGetSmsg(Flow *f, Packet *p, uint8_t flags) { StreamMsg *smsg = NULL; - if (p->proto == IPPROTO_TCP && f->protoctx != NULL) { + if (p->proto == IPPROTO_TCP && f->protoctx != NULL && (p->flags & PKT_STREAM_EST)) { TcpSession *ssn = (TcpSession *)f->protoctx; /* at stream eof, or in inline mode, inspect all smsg's */