]> git.baikalelectronics.ru Git - kernel.git/commit
netfilter: conntrack: do not renew entry stuck in tcp SYN_SENT state
authorFlorian Westphal <fw@strlen.de>
Thu, 24 Jun 2021 10:36:42 +0000 (12:36 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 6 Feb 2023 06:52:43 +0000 (07:52 +0100)
commit0017d69732e2ed0e67c7925bd3c05176cf733792
tree0a25f8ebbb97a637b697a3d0c2f46a14cff61ec4
parent5c3e57fbb1e4776e11b0e97df4867c863c0f5c4c
netfilter: conntrack: do not renew entry stuck in tcp SYN_SENT state

[ Upstream commit bc4d635e88c611e811852c9f65f0ac4c9ad3015a ]

Consider:
  client -----> conntrack ---> Host

client sends a SYN, but $Host is unreachable/silent.
Client eventually gives up and the conntrack entry will time out.

However, if the client is restarted with same addr/port pair, it
may prevent the conntrack entry from timing out.

This is noticeable when the existing conntrack entry has no NAT
transformation or an outdated one and port reuse happens either
on client or due to a NAT middlebox.

This change prevents refresh of the timeout for SYN retransmits,
so entry is going away after nf_conntrack_tcp_timeout_syn_sent
seconds (default: 60).

Entry will be re-created on next connection attempt, but then
nat rules will be evaluated again.

Signed-off-by: Florian Westphal <fw@strlen.de>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
net/netfilter/nf_conntrack_proto_tcp.c