This small change allows for easy per-route workarounds for broken hosts or
middleboxes that are not compliant with TCP standards for window scaling.
Rather than having to turn off window scaling globally. This patch allows
reducing or disabling window scaling if window clamp is present.
Example: Mark Lord reported a problem with 2.6.17 kernel being unable to
access http://www.everymac.com
# ip route add 216.145.246.23/32 via 10.8.0.1 window 65535
I would argue this ought to go in stable kernel as well.
Signed-off-by: Stephen Hemminger <[email protected]>
--- net-2.6.19.orig/net/ipv4/tcp_output.c
+++ net-2.6.19/net/ipv4/tcp_output.c
@@ -201,6 +201,7 @@ void tcp_select_initial_window(int __spa
* See RFC1323 for an explanation of the limit to 14
*/
space = max_t(u32, sysctl_tcp_rmem[2], sysctl_rmem_max);
+ space = min_t(u32, space, *window_clamp);
while (space > 65535 && (*rcv_wscale) < 14) {
space >>= 1;
(*rcv_wscale)++;
From: Stephen Hemminger <[email protected]>
Date: Fri, 18 Aug 2006 10:29:38 -0700
> This small change allows for easy per-route workarounds for broken hosts or
> middleboxes that are not compliant with TCP standards for window scaling.
> Rather than having to turn off window scaling globally. This patch allows
> reducing or disabling window scaling if window clamp is present.
>
> Example: Mark Lord reported a problem with 2.6.17 kernel being unable to
> access http://www.everymac.com
>
> # ip route add 216.145.246.23/32 via 10.8.0.1 window 65535
>
> I would argue this ought to go in stable kernel as well.
>
> Signed-off-by: Stephen Hemminger <[email protected]>
I want to think about this some more, it might have unintended
consequences. I really am not all that thrilled about putting in
workaround for this problem especially if it hurts a legitimate use of
some kind.
On Fri, 18 Aug 2006 17:00:30 -0700 (PDT)
David Miller <[email protected]> wrote:
> From: Stephen Hemminger <[email protected]>
> Date: Fri, 18 Aug 2006 10:29:38 -0700
>
> > This small change allows for easy per-route workarounds for broken hosts or
> > middleboxes that are not compliant with TCP standards for window scaling.
> > Rather than having to turn off window scaling globally. This patch allows
> > reducing or disabling window scaling if window clamp is present.
> >
> > Example: Mark Lord reported a problem with 2.6.17 kernel being unable to
> > access http://www.everymac.com
> >
> > # ip route add 216.145.246.23/32 via 10.8.0.1 window 65535
> >
> > I would argue this ought to go in stable kernel as well.
> >
> > Signed-off-by: Stephen Hemminger <[email protected]>
>
> I want to think about this some more, it might have unintended
> consequences. I really am not all that thrilled about putting in
> workaround for this problem especially if it hurts a legitimate use of
> some kind.
I was going for the least impact workaround using existing mechanisms.
There already is a way to set metrics per route. The code already limits
the window scale to the maximum possible window based on tcp memory limit
so it made sense to clamp based on congestion window as well.
It didn't make sense to add a new metric.
From: Stephen Hemminger <[email protected]>
Date: Fri, 18 Aug 2006 10:29:38 -0700
> This small change allows for easy per-route workarounds for broken hosts or
> middleboxes that are not compliant with TCP standards for window scaling.
> Rather than having to turn off window scaling globally. This patch allows
> reducing or disabling window scaling if window clamp is present.
>
> Example: Mark Lord reported a problem with 2.6.17 kernel being unable to
> access http://www.everymac.com
>
> # ip route add 216.145.246.23/32 via 10.8.0.1 window 65535
>
> I would argue this ought to go in stable kernel as well.
>
> Signed-off-by: Stephen Hemminger <[email protected]>
Ok applied. And I'll push this to -stable.
Thanks a lot Stephen.