1 From: Felix Fietkau <nbd@nbd.name>
2 Subject: netfilter: optional tcp window check
4 Signed-off-by: Felix Fietkau <nbd@nbd.name>
6 net/netfilter/nf_conntrack_proto_tcp.c | 13 +++++++++++++
7 1 file changed, 13 insertions(+)
9 --- a/net/netfilter/nf_conntrack_proto_tcp.c
10 +++ b/net/netfilter/nf_conntrack_proto_tcp.c
12 #include <net/netfilter/ipv4/nf_conntrack_ipv4.h>
13 #include <net/netfilter/ipv6/nf_conntrack_ipv6.h>
15 +/* Do not check the TCP window for incoming packets */
16 +static int nf_ct_tcp_no_window_check __read_mostly = 1;
18 /* "Be conservative in what you do,
19 be liberal in what you accept from others."
20 If it's non-zero, we mark only out of window RST segments as INVALID. */
21 @@ -513,6 +516,9 @@ static bool tcp_in_window(const struct n
23 bool res, in_recv_win;
25 + if (nf_ct_tcp_no_window_check)
29 * Get the required data from the packet.
31 @@ -1479,6 +1485,13 @@ static struct ctl_table tcp_sysctl_table
33 .proc_handler = proc_dointvec,
36 + .procname = "nf_conntrack_tcp_no_window_check",
37 + .data = &nf_ct_tcp_no_window_check,
38 + .maxlen = sizeof(unsigned int),
40 + .proc_handler = proc_dointvec,
44 #endif /* CONFIG_SYSCTL */