Skip to content

Commit bc39274

Browse files
committed
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. (cherry picked from commit 7ec9d72)
1 parent 181b3b2 commit bc39274

3 files changed

Lines changed: 8 additions & 1 deletion

File tree

rust/src/core.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,8 @@ pub const STREAM_TOCLIENT: u8 = 0x08;
4040
pub const STREAM_GAP: u8 = 0x10;
4141
pub const STREAM_DEPTH: u8 = 0x20;
4242
pub const STREAM_MIDSTREAM:u8 = 0x40;
43+
/// stream is async: packets are seen in only one direction.
44+
pub const STREAM_ASYNC: u8 = 0x80;
4345
pub const DIR_BOTH: u8 = 0b0000_1100;
4446
const DIR_TOSERVER: u8 = 0b0000_0100;
4547
const DIR_TOCLIENT: u8 = 0b0000_1000;

src/app-layer-parser.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -921,7 +921,7 @@ static void AppLayerParserFileTxHousekeeping(
921921
}
922922
}
923923

924-
#define IS_DISRUPTED(flags) ((flags) & (STREAM_DEPTH | STREAM_GAP))
924+
#define IS_DISRUPTED(flags) ((flags) & (STREAM_DEPTH | STREAM_GAP | STREAM_ASYNC))
925925

926926
extern int g_detect_disabled;
927927
extern bool g_file_logger_enabled;

src/flow.c

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

11871192
return newflags;

0 commit comments

Comments
 (0)