]> git.baikalelectronics.ru Git - kernel.git/commit
netfilter: conntrack: ignore overly delayed tcp packets
authorFlorian Westphal <fw@strlen.de>
Fri, 26 Aug 2022 13:32:25 +0000 (15:32 +0200)
committerFlorian Westphal <fw@strlen.de>
Wed, 7 Sep 2022 13:43:51 +0000 (15:43 +0200)
commit8213288439fbf20777faf780ecfa5e40b2755a71
tree006228ebc0e805fc52037d21d5c8f1cd1e6e4f16
parent73abcf9873e54455134c76223c58ef69b5ff7a8e
netfilter: conntrack: ignore overly delayed tcp packets

If 'nf_conntrack_tcp_loose' is off (the default), tcp packets that are
outside of the current window are marked as INVALID.

nf/iptables rulesets often drop such packets via 'ct state invalid' or
similar checks.

For overly delayed acks, this can be a nuisance if such 'invalid' packets
are also logged.

Since they are not invalid in a strict sense, just ignore them, i.e.
conntrack won't extend timeout or change state so that they do not match
invalid state rules anymore.

This also avoids unwantend connection stalls in case conntrack considers
retransmission (of data that did not reach the peer) as too old.

The else branch of the conditional becomes obsolete.
Next patch will reformant the now always-true if condition.

The existing workaround for data that exceeds the calculated receive
window is adjusted to use the 'ignore' state so that these packets do
not refresh the timeout or change state other than updating ->td_end.

Signed-off-by: Florian Westphal <fw@strlen.de>
net/netfilter/nf_conntrack_proto_tcp.c