From: Corey Hickey <bugfood-ml@fatooh.org>
To: Jozsef Kadlecsik <kadlec@blackhole.kfki.hu>
Cc: Eric Dumazet <eric.dumazet@gmail.com>,
Christoph Paasch <christoph.paasch@uclouvain.be>,
Linux Netdev List <netdev@vger.kernel.org>,
netfilter-devel@vger.kernel.org
Subject: Re: NAT stops forwarding ACKs after PMTU discovery
Date: Mon, 19 Aug 2013 21:18:15 -0700 [thread overview]
Message-ID: <5212EE07.2090803@fatooh.org> (raw)
In-Reply-To: <alpine.DEB.2.00.1308192330200.28532@blackhole.kfki.hu>
On 2013-08-19 15:07, Jozsef Kadlecsik wrote:
> It can be fixed by fixing the middlebox, or disabling SACK by the
> TCPOPTSTRIP target, or by relaxing conntrack. For the latter, the next
> untested patch may be sufficient:
>
> diff --git a/net/netfilter/nf_conntrack_proto_tcp.c b/net/netfilter/nf_conntrack_proto_tcp.c
> index 7dcc376..8b5d783 100644
> --- a/net/netfilter/nf_conntrack_proto_tcp.c
> +++ b/net/netfilter/nf_conntrack_proto_tcp.c
> @@ -649,6 +649,11 @@ static bool tcp_in_window(const struct nf_conn *ct,
> receiver->td_end, receiver->td_maxend, receiver->td_maxwin,
> receiver->td_scale);
>
> + /* Fall back to ACK when SACK is bogus */
> + if (!(before(sack, receiver->td_end + 1) &&
> + after(sack, receiver->td_end - MAXACKWINDOW(sender) - 1)))
> + sack = ack;
> +
> pr_debug("tcp_in_window: I=%i II=%i III=%i IV=%i\n",
> before(seq, sender->td_maxend + 1),
> after(end, sender->td_end - receiver->td_maxwin - 1),
>
> However it is good to cover the issue thus?
This didn't quite apply to my kernel tree, but I let patch apply it with
fuzz=2 and got:
diff --git a/net/netfilter/nf_conntrack_proto_tcp.c b/net/netfilter/nf_conntrack_proto_tcp.c
index 2f80107..94b326b 100644
--- a/net/netfilter/nf_conntrack_proto_tcp.c
+++ b/net/netfilter/nf_conntrack_proto_tcp.c
@@ -653,6 +653,11 @@ static bool tcp_in_window(const struct nf_conn *ct,
in_recv_win = !receiver->td_maxwin ||
after(end, sender->td_end - receiver->td_maxwin - 1);
+ /* Fall back to ACK when SACK is bogus */
+ if (!(before(sack, receiver->td_end + 1) &&
+ after(sack, receiver->td_end - MAXACKWINDOW(sender) - 1)))
+ sack = ack;
+
pr_debug("tcp_in_window: I=%i II=%i III=%i IV=%i\n",
before(seq, sender->td_maxend + 1),
(in_recv_win ? 1 : 0),
I can confirm, that does indeed work! Thank you. I will continue watching
this thread for other things to test, if need be.
-Corey
next prev parent reply other threads:[~2013-08-20 4:18 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <521061B4.1030508@fatooh.org>
2013-08-18 15:24 ` NAT stops forwarding ACKs after PMTU discovery Eric Dumazet
2013-08-18 16:59 ` Corey Hickey
2013-08-18 21:23 ` Jozsef Kadlecsik
2013-08-19 0:00 ` Eric Dumazet
2013-08-19 0:03 ` Eric Dumazet
2013-08-19 8:43 ` Corey Hickey
2013-08-19 12:33 ` Christoph Paasch
2013-08-19 13:24 ` Eric Dumazet
2013-08-19 13:49 ` Christoph Paasch
2013-08-19 13:58 ` Eric Dumazet
2013-08-19 14:35 ` Phil Oester
2013-08-19 15:32 ` Eric Dumazet
2013-08-19 15:33 ` Christoph Paasch
2013-08-19 16:00 ` Eric Dumazet
2013-08-19 17:15 ` Christoph Paasch
2013-08-19 18:00 ` Phil Oester
2013-08-19 18:10 ` Eric Dumazet
2013-08-19 14:43 ` Christoph Paasch
2013-08-19 20:13 ` Jozsef Kadlecsik
2013-08-19 20:43 ` Christoph Paasch
2013-08-19 21:08 ` Eric Dumazet
2013-08-19 22:07 ` Jozsef Kadlecsik
2013-08-20 4:18 ` Corey Hickey [this message]
2013-08-19 18:22 ` Corey Hickey
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=5212EE07.2090803@fatooh.org \
--to=bugfood-ml@fatooh.org \
--cc=christoph.paasch@uclouvain.be \
--cc=eric.dumazet@gmail.com \
--cc=kadlec@blackhole.kfki.hu \
--cc=netdev@vger.kernel.org \
--cc=netfilter-devel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).