All of lore.kernel.org
 help / color / mirror / Atom feed
From: Eric Dumazet <eric.dumazet@gmail.com>
To: David Miller <davem@davemloft.net>
Cc: ilpo.jarvinen@helsinki.fi, ole@ans.pl,
	herbert@gondor.apana.org.au,
	Linux Netdev List <netdev@vger.kernel.org>
Subject: Re: Problem with tcp (2.6.31) as first
Date: Mon, 30 Nov 2009 10:12:19 +0100	[thread overview]
Message-ID: <4B138C73.8040401@gmail.com> (raw)
In-Reply-To: <20091129.233447.60856273.davem@davemloft.net>

David Miller a écrit :
> From: Eric Dumazet <eric.dumazet@gmail.com>
> Date: Thu, 26 Nov 2009 23:42:46 +0100
> 
>> Following patch solves this problem, but maybe we need a flag
>> (a la sk->sk_userlocks |= SOCK_WINCLAMP_LOCK;)
>> in case user set window_clamp.
>> Or just document the clearing after a tcp disconnect ?
>>
>> [PATCH] tcp: tcp_disconnect() should clear window_clamp
>>
>> Or reuse of socket possibly selects a small window, wscale = 0 for next connection.
> 
> Eric, can you post this with proper signoff to netdev?
> 
> Thanks.

Sure, here it is.

Thanks

[PATCH] 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 <ole@ans.pl>
Tested-by: Krzysztof Oledzki <ole@ans.pl>
Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
---

diff --git a/net/ipv4/tcp.c b/net/ipv4/tcp.c
index f1813bc..d7a884c 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)

  parent reply	other threads:[~2009-11-30  9:12 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <alpine.LNX.1.10.0911251626500.13662@bizon.gios.gov.pl>
     [not found] ` <4B0D83E8.3000009@gmail.com>
     [not found]   ` <4B0D86BD.4010902@ans.pl>
     [not found]     ` <4B0D8EC6.9050204@gmail.com>
     [not found]       ` <4B0D8FB2.1060606@ans.pl>
     [not found]         ` <4B0E1D1C.30000@gmail.com>
     [not found]           ` <4B0E6D50.1020906@ans.pl>
     [not found]             ` <4B0EAC4F.3080202@gmail.com>
     [not found]               ` <alpine.LNX.1.10.0911261749100.16993@bizon.gios.gov.pl>
     [not found]                 ` <4B0EE958.7090607@gmail.com>
     [not found]                   ` <4B0EECE5.5050406@ans.pl>
     [not found]                     ` <4B0EEF76.1070803@gmail.com>
     [not found]                       ` <4B0EF273.4030003@gmail.com>
     [not found]                         ` <alpine.DEB.2.00.0911262327130.24189@melkinpaasi.cs.helsinki.fi>
     [not found]                           ` <4B0F0466.8080006@gmail.com>
     [not found]                             ` <alpine.LNX.1.10.0911271013330.24080@bizon.gios.gov.pl>
     [not found]                               ` <alpine.DEB.2.00.0911271246030.2459@melkinpaasi.cs.helsinki.fi>
2009-11-27 11:43                                 ` Problem with tcp (2.6.31) as first, http://bugzilla.kernel.org/show_bug.cgi?id=14580 Krzysztof Olędzki
2009-11-27 11:48                                 ` Eric Dumazet
     [not found]                             ` <20091129.233447.60856273.davem@davemloft.net>
2009-11-30  9:12                               ` Eric Dumazet [this message]
2009-11-30 20:56                                 ` Problem with tcp (2.6.31) as first David Miller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4B138C73.8040401@gmail.com \
    --to=eric.dumazet@gmail.com \
    --cc=davem@davemloft.net \
    --cc=herbert@gondor.apana.org.au \
    --cc=ilpo.jarvinen@helsinki.fi \
    --cc=netdev@vger.kernel.org \
    --cc=ole@ans.pl \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.