--- a/net/netfilter/nf_conntrack_proto_tcp.c
+++ b/net/netfilter/nf_conntrack_proto_tcp.c
-@@ -31,6 +31,9 @@
- #include <net/netfilter/ipv4/nf_conntrack_ipv4.h>
- #include <net/netfilter/ipv6/nf_conntrack_ipv6.h>
-
-+/* Do not check the TCP window for incoming packets */
-+static int nf_ct_tcp_no_window_check __read_mostly = 1;
-+
- /* FIXME: Examine ipfilter's timeouts and conntrack transitions more
- closely. They're more complex. --RR */
-
@@ -476,6 +479,9 @@ static bool tcp_in_window(const struct n
s32 receiver_offset;
bool res, in_recv_win;
-+ if (nf_ct_tcp_no_window_check)
++ if (net->ct.sysctl_no_window_check)
+ return true;
+
/*
timeouts[new_state] > timeouts[TCP_CONNTRACK_UNACK])
timeout = timeouts[TCP_CONNTRACK_UNACK];
- else if (ct->proto.tcp.last_win == 0 &&
-+ else if (!nf_ct_tcp_no_window_check && ct->proto.tcp.last_win == 0 &&
++ else if (!net->ct.sysctl_no_window_check && ct->proto.tcp.last_win == 0 &&
timeouts[new_state] > timeouts[TCP_CONNTRACK_RETRANS])
timeout = timeouts[TCP_CONNTRACK_RETRANS];
else
--- a/net/netfilter/nf_conntrack_standalone.c
+++ b/net/netfilter/nf_conntrack_standalone.c
-@@ -25,6 +25,9 @@
- #include <net/netfilter/nf_conntrack_timestamp.h>
- #include <linux/rculist_nulls.h>
-
-+/* Do not check the TCP window for incoming packets */
-+static int nf_ct_tcp_no_window_check __read_mostly = 1;
-+
- static bool enable_hooks __read_mostly;
- MODULE_PARM_DESC(enable_hooks, "Always enable conntrack hooks");
- module_param(enable_hooks, bool, 0000);
@@ -660,6 +663,7 @@ enum nf_ct_sysctl_index {
NF_SYSCTL_CT_PROTO_TIMEOUT_GRE_STREAM,
#endif
#endif
+ [NF_SYSCTL_CT_PROTO_TCP_NO_WINDOW_CHECK] = {
+ .procname = "nf_conntrack_tcp_no_window_check",
-+ .data = &nf_ct_tcp_no_window_check,
++ .data = &init_net.ct.sysctl_no_window_check,
+ .maxlen = sizeof(unsigned int),
+ .mode = 0644,
+ .proc_handler = proc_dointvec,
{}
};
+@@ -1164,6 +1164,7 @@ static int nf_conntrack_standalone_init_sysctl(struct net *net)
+ #ifdef CONFIG_NF_CONNTRACK_EVENTS
+ table[NF_SYSCTL_CT_EVENTS].data = &net->ct.sysctl_events;
+ #endif
++ table[NF_SYSCTL_CT_PROTO_TCP_NO_WINDOW_CHECK].data = &net->ct.sysctl_no_window_check;
+ #ifdef CONFIG_NF_CONNTRACK_TIMESTAMP
+ table[NF_SYSCTL_CT_TIMESTAMP].data = &net->ct.sysctl_tstamp;
+ #endif
+@@ -1220,6 +1220,7 @@
+ int ret;
+
+ net->ct.sysctl_checksum = 1;
++ net->ct.sysctl_no_window_check = 1;
+
+ ret = nf_conntrack_standalone_init_sysctl(net);
+ if (ret < 0)
+--- a/include/net/netns/conntrack.h
++++ b/include/net/netns/conntrack.h
+@@ -109,6 +109,7 @@ struct netns_ct {
+ u8 sysctl_auto_assign_helper;
+ u8 sysctl_tstamp;
+ u8 sysctl_checksum;
++ u8 sysctl_no_window_check;
+
+ struct ct_pcpu __percpu *pcpu_lists;
+ struct ip_conntrack_stat __percpu *stat;