netdev
[Top] [All Lists]

Re: Known problems with TCP window size on 2.6.7?

To: Herbert Xu <herbert@xxxxxxxxxxxxxxxxxxx>
Subject: Re: Known problems with TCP window size on 2.6.7?
From: "David S. Miller" <davem@xxxxxxxxxxxxx>
Date: Wed, 27 Oct 2004 14:53:56 -0700
Cc: vandrove@xxxxxxxxxx, netdev@xxxxxxxxxxx
In-reply-to: <E1CMml4-0001Cm-00@xxxxxxxxxxxxxxxxxxxxxxxx>
References: <20041027110617.GA28757@xxxxxxxxxxxxxxx> <E1CMml4-0001Cm-00@xxxxxxxxxxxxxxxxxxxxxxxx>
Sender: netdev-bounce@xxxxxxxxxxx
On Wed, 27 Oct 2004 22:18:30 +1000
Herbert Xu <herbert@xxxxxxxxxxxxxxxxxxx> wrote:

> Petr Vandrovec <vandrove@xxxxxxxxxx> wrote:
> >   are there some known problems with 2.6.7 and TCP window growing up over 
> > limits?  
> 
> No.

Actually Herbert, we did have a window 16-bit overflow problem in 2.6.7
which I believe was first fixed in 2.6.8 or so.  It was fixed by this
patch:

# This is a BitKeeper generated diff -Nru style patch.
#
# ChangeSet
#   2004/07/22 14:01:38-07:00 davem@xxxxxxxxxxxxxxxxxx 
#   [TCP]: Do not overflow 16-bit window field in tcp_select_window().
#   
#   Signed-off-by: David S. Miller <davem@xxxxxxxxxx>
# 
# net/ipv4/tcp_output.c
#   2004/07/22 14:01:10-07:00 davem@xxxxxxxxxxxxxxxxxx +8 -0
#   [TCP]: Do not overflow 16-bit window field in tcp_select_window().
#   
#   Signed-off-by: David S. Miller <davem@xxxxxxxxxx>
# 
diff -Nru a/net/ipv4/tcp_output.c b/net/ipv4/tcp_output.c
--- a/net/ipv4/tcp_output.c     2004-10-27 14:39:15 -07:00
+++ b/net/ipv4/tcp_output.c     2004-10-27 14:39:15 -07:00
@@ -168,6 +168,14 @@
        tp->rcv_wnd = new_win;
        tp->rcv_wup = tp->rcv_nxt;
 
+       /* Make sure we do not exceed the maximum possible
+        * scaled window.
+        */
+       if (!tp->rcv_wscale)
+               new_win = min(new_win, MAX_TCP_WINDOW);
+       else
+               new_win = min(new_win, (65535U << tp->rcv_wscale));
+
        /* RFC1323 scaling applied */
        new_win >>= tp->rcv_wscale;
 

<Prev in Thread] Current Thread [Next in Thread>