nfqws: allow resetting conntrack entry in any state on SYN

This commit is contained in:
bol-van
2021-03-20 11:38:00 +03:00
parent 5705c3ff8e
commit 17867c25b7
9 changed files with 5 additions and 8 deletions

View File

@@ -126,17 +126,14 @@ static void ConntrackFeedPacket(t_ctrack *t, bool bReverse, const struct tcphdr
uint8_t scale;
if (tcp_syn_segment(tcphdr))
{
if (t->state==FIN) ConntrackInitTrack(t); // erase current entry
if (t->state==SYN) t->seq0 = htonl(tcphdr->th_seq);
ConntrackInitTrack(t); // erase current entry
t->seq0 = htonl(tcphdr->th_seq);
}
else if (tcp_synack_segment(tcphdr))
{
if (t->state==FIN) ConntrackInitTrack(t); // erase current entry
if (t->state==SYN)
{
if (!t->seq0) t->seq0 = htonl(tcphdr->th_ack)-1;
t->ack0 = htonl(tcphdr->th_seq);
}
ConntrackInitTrack(t); // erase current entry
if (!t->seq0) t->seq0 = htonl(tcphdr->th_ack)-1;
t->ack0 = htonl(tcphdr->th_seq);
}
else if (tcphdr->th_flags & (TH_FIN|TH_RST))
{