}
}
+/**
+ * \brief See if stream engine is dropping invalid packet in inline mode
+ *
+ * \retval 0 no
+ * \retval 1 yes
+ */
+int StreamTcpInlineDropInvalid(void)
+{
+ return (stream_inline && (stream_config.flags & STREAMTCP_INIT_FLAG_DROP_INVALID));
+}
+
/** \brief To initialize the stream global configuration data
*
* \param quiet It tells the mode of operation, if it is TRUE nothing will
stream_config.bypass = 0;
}
+ int drop_invalid = 0;
+ if ((ConfGetBool("stream.drop-invalid", &drop_invalid)) == 1) {
+ if (drop_invalid == 1) {
+ stream_config.flags |= STREAMTCP_INIT_FLAG_DROP_INVALID;
+ }
+ } else {
+ stream_config.flags |= STREAMTCP_INIT_FLAG_DROP_INVALID;
+ }
+
if (!quiet) {
SCLogConfig("stream \"bypass\": %s", bypass ? "enabled" : "disabled");
}
ReCalculateChecksum(p);
}
- if (StreamTcpInlineMode()) {
+ if (StreamTcpInlineDropInvalid()) {
PACKET_DROP(p);
}
SCReturnInt(-1);
#define STREAM_VERBOSE FALSE
/* Flag to indicate that the checksum validation for the stream engine
has been enabled */
-#define STREAMTCP_INIT_FLAG_CHECKSUM_VALIDATION 0x01
+#define STREAMTCP_INIT_FLAG_CHECKSUM_VALIDATION BIT_U8(0)
+#define STREAMTCP_INIT_FLAG_DROP_INVALID BIT_U8(1)
/*global flow data*/
typedef struct TcpStreamCnf_ {
void StreamTcpStreamCleanup(TcpStream *stream);
/* check if bypass is enabled */
int StreamTcpBypassEnabled(void);
+int StreamTcpInlineDropInvalid(void);
int TcpSessionPacketSsnReuse(const Packet *p, const Flow *f, const void *tcp_ssn);
# midstream: false # don't allow midstream session pickups
# async-oneside: false # don't enable async stream handling
# inline: no # stream inline mode
+# drop-invalid: yes # in inline mode, drop packets that are invalid with regards to streaming engine
# max-synack-queued: 5 # Max different SYN/ACKs to queue
# bypass: no # Bypass packets when stream.depth is reached
#