tcp: tcp_disconnect() should clear window_clamp
authorEric Dumazet <eric.dumazet@gmail.com>
Mon, 30 Nov 2009 20:53:30 +0000 (12:53 -0800)
committerDavid S. Miller <davem@davemloft.net>
Mon, 30 Nov 2009 20:53:30 +0000 (12:53 -0800)
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 <ole@ans.pl>
Tested-by: Krzysztof Oledzki <ole@ans.pl>
Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/ipv4/tcp.c

index f1813bc7108811a50ff8284775ad053623903a2e..d7a884c534a6b12d7413c719a9aee3e923e28739 100644 (file)
@@ -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);