From 0c76290440c94494f075b6471cb6103c8929157f Mon Sep 17 00:00:00 2001 From: bol-van Date: Sun, 21 Mar 2021 10:39:52 +0300 Subject: [PATCH] nfqws: do not reset conntrack entry in SYN state --- nfq/conntrack.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/nfq/conntrack.c b/nfq/conntrack.c index f006959..3cd7220 100644 --- a/nfq/conntrack.c +++ b/nfq/conntrack.c @@ -126,12 +126,12 @@ static void ConntrackFeedPacket(t_ctrack *t, bool bReverse, const struct tcphdr uint8_t scale; if (tcp_syn_segment(tcphdr)) { - ConntrackInitTrack(t); // erase current entry + if (t->state!=SYN) ConntrackInitTrack(t); // erase current entry t->seq0 = htonl(tcphdr->th_seq); } else if (tcp_synack_segment(tcphdr)) { - ConntrackInitTrack(t); // erase current entry + if (t->state!=SYN) ConntrackInitTrack(t); // erase current entry if (!t->seq0) t->seq0 = htonl(tcphdr->th_ack)-1; t->ack0 = htonl(tcphdr->th_seq); }