kernel: update 3.18 to 3.18.1
[openwrt.git] / target / linux / generic / patches-3.18 / 613-netfilter_optional_tcp_window_check.patch
1 --- a/net/netfilter/nf_conntrack_proto_tcp.c
2 +++ b/net/netfilter/nf_conntrack_proto_tcp.c
3 @@ -33,6 +33,9 @@
4  #include <net/netfilter/ipv4/nf_conntrack_ipv4.h>
5  #include <net/netfilter/ipv6/nf_conntrack_ipv6.h>
6  
7 +/* Do not check the TCP window for incoming packets  */
8 +static int nf_ct_tcp_no_window_check __read_mostly = 1;
9 +
10  /* "Be conservative in what you do,
11      be liberal in what you accept from others."
12      If it's non-zero, we mark only out of window RST segments as INVALID. */
13 @@ -515,6 +518,9 @@ static bool tcp_in_window(const struct n
14         s32 receiver_offset;
15         bool res, in_recv_win;
16  
17 +       if (nf_ct_tcp_no_window_check)
18 +               return true;
19 +
20         /*
21          * Get the required data from the packet.
22          */
23 @@ -1452,6 +1458,13 @@ static struct ctl_table tcp_sysctl_table
24                 .mode           = 0644,
25                 .proc_handler   = proc_dointvec,
26         },
27 +       {
28 +               .procname       = "nf_conntrack_tcp_no_window_check",
29 +               .data           = &nf_ct_tcp_no_window_check,
30 +               .maxlen         = sizeof(unsigned int),
31 +               .mode           = 0644,
32 +               .proc_handler   = proc_dointvec,
33 +       },
34         { }
35  };
36