From: Eric Dumazet Date: Mon, 30 Nov 2009 20:53:30 +0000 (-0800) Subject: tcp: tcp_disconnect() should clear window_clamp X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=1fdf475aa141a669af8db6ccc7015f0b725087de;p=openwrt%2Fstaging%2Fblogic.git tcp: tcp_disconnect() should clear window_clamp NFS can reuse its TCP socket after calling tcp_disconnect(). We noticed window scaling was not negotiated in SYN packet of next connection request. Fix is to clear tp->window_clamp in tcp_disconnect(). Reported-by: Krzysztof Oledzki Tested-by: Krzysztof Oledzki Signed-off-by: Eric Dumazet Signed-off-by: David S. Miller --- diff --git a/net/ipv4/tcp.c b/net/ipv4/tcp.c index f1813bc71088..d7a884c534a6 100644 --- a/net/ipv4/tcp.c +++ b/net/ipv4/tcp.c @@ -2059,6 +2059,7 @@ int tcp_disconnect(struct sock *sk, int flags) tp->snd_ssthresh = TCP_INFINITE_SSTHRESH; tp->snd_cwnd_cnt = 0; tp->bytes_acked = 0; + tp->window_clamp = 0; tcp_set_ca_state(sk, TCP_CA_Open); tcp_clear_retrans(tp); inet_csk_delack_init(sk);