Skip to content

Commit

Permalink
tcp: Bug fix in initialization of receive window.
Browse files Browse the repository at this point in the history
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>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Nandita Dukkipati authored and David S. Miller committed Dec 8, 2010
1 parent ce9aeb5 commit b1afde6
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions net/ipv4/tcp_output.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down

0 comments on commit b1afde6

Please sign in to comment.