--- zzzz-none-000/linux-4.4.60/net/netfilter/nf_conntrack_proto_tcp.c 2017-04-08 07:53:53.000000000 +0000 +++ scorpion-7490-727/linux-4.4.60/net/netfilter/nf_conntrack_proto_tcp.c 2021-02-04 17:41:59.000000000 +0000 @@ -33,10 +33,15 @@ #include #include +/* Do not check the TCP window for incoming packets */ +int nf_ct_tcp_no_window_check __read_mostly = 1; +EXPORT_SYMBOL_GPL(nf_ct_tcp_no_window_check); + /* "Be conservative in what you do, be liberal in what you accept from others." If it's non-zero, we mark only out of window RST segments as INVALID. */ -static int nf_ct_tcp_be_liberal __read_mostly = 0; +int nf_ct_tcp_be_liberal __read_mostly; +EXPORT_SYMBOL_GPL(nf_ct_tcp_be_liberal); /* If it is set to zero, we disable picking up already established connections. */ @@ -453,7 +458,7 @@ /* Fast path for timestamp-only option */ if (length == TCPOLEN_TSTAMP_ALIGNED - && *(__be32 *)ptr == htonl((TCPOPT_NOP << 24) + && net_hdr_word(ptr) == htonl((TCPOPT_NOP << 24) | (TCPOPT_NOP << 16) | (TCPOPT_TIMESTAMP << 8) | TCPOLEN_TIMESTAMP)) @@ -515,6 +520,9 @@ s32 receiver_offset; bool res, in_recv_win; + if (nf_ct_tcp_no_window_check) + return true; + /* * Get the required data from the packet. */ @@ -1481,6 +1489,13 @@ .mode = 0644, .proc_handler = proc_dointvec, }, + { + .procname = "nf_conntrack_tcp_no_window_check", + .data = &nf_ct_tcp_no_window_check, + .maxlen = sizeof(unsigned int), + .mode = 0644, + .proc_handler = proc_dointvec, + }, { } };