aboutsummaryrefslogtreecommitdiff
path: root/analyzer/analyzer.c
diff options
context:
space:
mode:
authorMosder <xmosder12@gmail.com>2026-07-14 13:40:17 +0200
committerMosder <xmosder12@gmail.com>2026-07-14 13:40:17 +0200
commitc7277e7654c0d8d0e7a4665373c0762c6e8a038d (patch)
treebd6e5c7cc864e423cb3285c40c5a8217a19fbf52 /analyzer/analyzer.c
parent4dbef658e31e0520d77f90df2bb3e66c21ce2ea4 (diff)
fix: fixed not handling of different connections and bug regarding TCP SYN packet
Diffstat (limited to 'analyzer/analyzer.c')
-rw-r--r--analyzer/analyzer.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/analyzer/analyzer.c b/analyzer/analyzer.c
index 03ecd2a..7def1e6 100644
--- a/analyzer/analyzer.c
+++ b/analyzer/analyzer.c
@@ -15,8 +15,8 @@ void analyzer_loop(TCPStream *stream, pcap_t *pcap_handle, void (*parsed_data_ha
// get new segment
TCPSegment segment = get_segment_from_packet(packet, packet_data);
- // handle the new segment
- if (handle_segment(stream, segment)) {
+ // handle the new segment if it's correct one and has data in it (ignore SYN)
+ if (segment.len > 0 && handle_segment(stream, segment)) {
// if it was added to the stream - parse it
size_t parsed_len;
size_t n_parsed_data;