]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
detect: don't consider smsgs for no inspect flag
authorVictor Julien <victor@inliniac.net>
Fri, 22 Nov 2013 17:11:10 +0000 (18:11 +0100)
committerVictor Julien <victor@inliniac.net>
Fri, 22 Nov 2013 17:11:10 +0000 (18:11 +0100)
When the PKT_NOPAYLOAD_INSPECTION flag is set, don't apply it to smsgs.
This way we can still inspect the outstanding smsgs.

The PKT_NOPAYLOAD_INSPECTION is set for encrypted traffic, and is combined
with disabling stream reassembly. So we only inspect the smsgs up to the
point of the disable detection point.

src/detect.c

index 2e57f877866c4a4448486770c7e7a5b23a6fece4..a6b47f4ed22ea59dad2f2e410ac1cb3892ed5631 100644 (file)
@@ -2045,7 +2045,8 @@ static void
 PacketCreateMask(Packet *p, SignatureMask *mask, uint16_t alproto, void *alstate, StreamMsg *smsg,
         int app_decoder_events)
 {
-    if (!(p->flags & PKT_NOPAYLOAD_INSPECTION) && (p->payload_len > 0 || smsg != NULL)) {
+    /* no payload inspect flag doesn't apply to smsg */
+    if (smsg != NULL || (!(p->flags & PKT_NOPAYLOAD_INSPECTION) && p->payload_len > 0)) {
         SCLogDebug("packet has payload");
         (*mask) |= SIG_MASK_REQUIRE_PAYLOAD;
     } else {