613-netfilter_optional_tcp_window_check.patch 1.0 KB

123456789101112131415161718192021222324252627282930313233343536
  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. +/* Do not check the TCP window for incoming packets */
  7. +static int nf_ct_tcp_no_window_check __read_mostly = 1;
  8. +
  9. /* "Be conservative in what you do,
  10. be liberal in what you accept from others."
  11. If it's non-zero, we mark only out of window RST segments as INVALID. */
  12. @@ -515,6 +518,9 @@ static bool tcp_in_window(const struct n
  13. s32 receiver_offset;
  14. bool res, in_recv_win;
  15. + if (nf_ct_tcp_no_window_check)
  16. + return true;
  17. +
  18. /*
  19. * Get the required data from the packet.
  20. */
  21. @@ -1481,6 +1487,13 @@ static struct ctl_table tcp_sysctl_table
  22. .mode = 0644,
  23. .proc_handler = proc_dointvec,
  24. },
  25. + {
  26. + .procname = "nf_conntrack_tcp_no_window_check",
  27. + .data = &nf_ct_tcp_no_window_check,
  28. + .maxlen = sizeof(unsigned int),
  29. + .mode = 0644,
  30. + .proc_handler = proc_dointvec,
  31. + },
  32. { }
  33. };