--- zzzz-none-000/linux-4.4.271/net/netfilter/nf_conntrack_proto_tcp.c 2021-06-03 06:22:09.000000000 +0000 +++ hawkeye-5590-750/linux-4.4.271/net/netfilter/nf_conntrack_proto_tcp.c 2023-04-19 10:22:30.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. */ @@ -455,7 +460,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)) @@ -519,6 +524,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. */ @@ -1485,6 +1493,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, + }, { } };