Skip to content

Commit 7ec9d72

Browse files
catenacybervictorjulien
authored andcommitted
stream: disrupt never seen direction with async-oneside
Ticket: 8629 When we are in async-oneside mode, we see only one direction of the traffic, and should not wait for the other direction before cleaning up a transaction.
1 parent c8f68b0 commit 7ec9d72

3 files changed

Lines changed: 8 additions & 1 deletion

File tree

rust/ffi/src/lib.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,8 @@ pub const STREAM_TOCLIENT: u8 = 0x08;
3636
pub const STREAM_GAP: u8 = 0x10;
3737
pub const STREAM_DEPTH: u8 = 0x20;
3838
pub const STREAM_MIDSTREAM: u8 = 0x40;
39+
/// stream is async : packets are seen in only one direction.
40+
pub const STREAM_ASYNC: u8 = 0x80;
3941

4042
/// Cast pointer to a variable, as a mutable reference to an object
4143
///

src/app-layer-parser.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -908,7 +908,7 @@ static void AppLayerParserFileTxHousekeeping(
908908
}
909909
}
910910

911-
#define IS_DISRUPTED(flags) ((flags) & (STREAM_DEPTH | STREAM_GAP))
911+
#define IS_DISRUPTED(flags) ((flags) & (STREAM_DEPTH | STREAM_GAP | STREAM_ASYNC))
912912

913913
extern int g_detect_disabled;
914914
extern bool g_file_logger_enabled;

src/flow.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1184,6 +1184,11 @@ uint8_t FlowGetDisruptionFlags(const Flow *f, uint8_t flags)
11841184
if (stream->flags & STREAMTCP_STREAM_FLAG_DEPTH_REACHED) {
11851185
newflags |= STREAM_DEPTH;
11861186
}
1187+
if (ssn->flags & STREAMTCP_FLAG_ASYNC) {
1188+
if (stream->tcp_flags == 0) {
1189+
newflags |= STREAM_ASYNC;
1190+
}
1191+
}
11871192
/* todo: handle pass case (also for UDP!) */
11881193

11891194
return newflags;

0 commit comments

Comments
 (0)