All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/1] TCP: Bug fix in initialization of receive window.
@ 2010-12-03 23:33 Nandita Dukkipati
  2010-12-08 17:41 ` David Miller
  0 siblings, 1 reply; 2+ messages in thread
From: Nandita Dukkipati @ 2010-12-03 23:33 UTC (permalink / raw)
  To: David S. Miller; +Cc: Laurent Chavey, Yuchung Cheng, netdev, Nandita Dukkipati

The bug has to do with boundary checks on the initial receive window.
If the initial receive window falls between init_cwnd and the
receive window specified by the user, the initial window is incorrectly
brought down to init_cwnd. The correct behavior is to allow it to
remain unchanged.

Signed-off-by: Nandita Dukkipati <nanditad@google.com>
---
 net/ipv4/tcp_output.c |    9 ++++-----
 1 files changed, 4 insertions(+), 5 deletions(-)

diff --git a/net/ipv4/tcp_output.c b/net/ipv4/tcp_output.c
index 749b649..31fd0bd 100644
--- a/net/ipv4/tcp_output.c
+++ b/net/ipv4/tcp_output.c
@@ -231,11 +231,10 @@ void tcp_select_initial_window(int __space, __u32 mss,
 		/* when initializing use the value from init_rcv_wnd
 		 * rather than the default from above
 		 */
-		if (init_rcv_wnd &&
-		    (*rcv_wnd > init_rcv_wnd * mss))
-			*rcv_wnd = init_rcv_wnd * mss;
-		else if (*rcv_wnd > init_cwnd * mss)
-			*rcv_wnd = init_cwnd * mss;
+		if (init_rcv_wnd)
+			*rcv_wnd = min(*rcv_wnd, init_rcv_wnd * mss);
+		else
+			*rcv_wnd = min(*rcv_wnd, init_cwnd * mss);
 	}
 
 	/* Set the clamp no higher than max representable value */
-- 
1.7.3.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH 1/1] TCP: Bug fix in initialization of receive window.
  2010-12-03 23:33 [PATCH 1/1] TCP: Bug fix in initialization of receive window Nandita Dukkipati
@ 2010-12-08 17:41 ` David Miller
  0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2010-12-08 17:41 UTC (permalink / raw)
  To: nanditad; +Cc: chavey, ycheng, netdev

From: Nandita Dukkipati <nanditad@google.com>
Date: Fri,  3 Dec 2010 15:33:44 -0800

> The bug has to do with boundary checks on the initial receive window.
> If the initial receive window falls between init_cwnd and the
> receive window specified by the user, the initial window is incorrectly
> brought down to init_cwnd. The correct behavior is to allow it to
> remain unchanged.
> 
> Signed-off-by: Nandita Dukkipati <nanditad@google.com>

Applied and queued up for -stable, thanks.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2010-12-08 17:40 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-12-03 23:33 [PATCH 1/1] TCP: Bug fix in initialization of receive window Nandita Dukkipati
2010-12-08 17:41 ` David Miller

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.