From be2849044b164d49a6f009a3b39d1370916c1bbc Mon Sep 17 00:00:00 2001 From: Victor Julien Date: Thu, 16 Jul 2015 12:49:38 +0200 Subject: [PATCH] flow/stream: xfer noinspect flags to pseudo pkts Set noinspection flags for payloads and packets on flow and stream pseudo packets. Without these, the pseudo packets could trigger inspection even though this was disabled for a flow. --- src/flow-timeout.c | 8 ++++++++ src/stream-tcp.c | 7 +++++++ 2 files changed, 15 insertions(+) diff --git a/src/flow-timeout.c b/src/flow-timeout.c index b18007939e..534875c68b 100644 --- a/src/flow-timeout.c +++ b/src/flow-timeout.c @@ -87,6 +87,14 @@ static inline Packet *FlowForceReassemblyPseudoPacketSetup(Packet *p, p->flags |= PKT_STREAM_EOF; p->flags |= PKT_HAS_FLOW; p->flags |= PKT_PSEUDO_STREAM_END; + + if (f->flags & FLOW_NOPACKET_INSPECTION) { + DecodeSetNoPacketInspectionFlag(p); + } + if (f->flags & FLOW_NOPAYLOAD_INSPECTION) { + DecodeSetNoPayloadInspectionFlag(p); + } + if (direction == 0) p->flowflags |= FLOW_PKT_TOSERVER; else diff --git a/src/stream-tcp.c b/src/stream-tcp.c index c810ea75c0..88fe40d4be 100644 --- a/src/stream-tcp.c +++ b/src/stream-tcp.c @@ -5836,6 +5836,13 @@ void StreamTcpPseudoPacketCreateStreamEndPacket(ThreadVars *tv, StreamTcpThread np->flags |= PKT_HAS_FLOW; np->flags |= PKT_PSEUDO_STREAM_END; + if (p->flags & PKT_NOPACKET_INSPECTION) { + DecodeSetNoPacketInspectionFlag(np); + } + if (p->flags & PKT_NOPAYLOAD_INSPECTION) { + DecodeSetNoPayloadInspectionFlag(np); + } + if (PKT_IS_TOSERVER(p)) { SCLogDebug("original is to_server, so pseudo is to_client"); np->flowflags &= ~FLOW_PKT_TOSERVER; -- 2.47.2