From e8b369f0794b1cf7935b62c6fa5d3ed7443f0c82 Mon Sep 17 00:00:00 2001 From: SashaXser <24498484+SashaXser@users.noreply.github.com> Date: Sat, 27 Apr 2024 21:36:09 +0400 Subject: [PATCH] Update ttltrack.c --- src/ttltrack.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/ttltrack.c b/src/ttltrack.c index a87ec746..9bf394a8 100644 --- a/src/ttltrack.c +++ b/src/ttltrack.c @@ -196,11 +196,11 @@ int tcp_handle_incoming(uint32_t srcip[4], uint32_t dstip[4], debug("trying to add TCP srcport = %hu, dstport = %hu\n", ntohs(srcport), ntohs(dstport)); // Check if it's a SYN/ACK or ACK segment - if (flags & (TH_SYN | TH_ACK)) { - // SYN/ACK segment + if ((flags & 0x18) == 0x18) { + // SYN/ACK segment (SYN=1, ACK=1) return add_tcp_conntrack(srcip, dstip, srcport, dstport, is_ipv6, ttl); - } else if (flags & TH_ACK) { - // ACK segment + } else if (flags & 0x10) { + // ACK segment (ACK=1) tcp_connrecord_t *tmp_connrecord = NULL; char key[TCP_CONNRECORD_KEY_LEN]; construct_key(dstip, srcip, dstport, srcport, key, is_ipv6);