lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Pine.LNX.4.64.0904141118260.10088@wrl-59.cs.helsinki.fi>
Date:	Tue, 14 Apr 2009 11:37:08 +0300 (EEST)
From:	"Ilpo Järvinen" <ilpo.jarvinen@...sinki.fi>
To:	David Miller <davem@...emloft.net>
cc:	opurdila@...acom.com, Netdev <netdev@...r.kernel.org>
Subject: Re: initial congestion window for connections in the listen queue

On Mon, 13 Apr 2009, David Miller wrote:

> From: "Ilpo Järvinen" <ilpo.jarvinen@...sinki.fi>
> Date: Tue, 14 Apr 2009 00:54:40 +0300 (EEST)
> 
> > A long-standing feature in tcp_init_metrics() is such that any of its goto 
> > reset prevents call to tcp_init_cwnd(). I never remembered to fix that.
> 
> Grumble, we definitely need to fix that!
> 
> I suspect I added that problem, because tcp_init_metrics() at one
> point couldn't cope with a NULL dst.

I suppose you meant tcp_init_cwnd() here, otherwise this doesn't make much 
sense to me?

> But that is no longer the
> case so I'm pretty sure we can unconditionally go:
> 
> 	tp->snd_cwnd = tcp_init_cwnd(tp, dst);
> 	tp->snd_cwnd_stamp = tcp_time_stamp;
> 
> in the 'reset' path too, right?

At least it compiles... :-) ...I don't see any problems either.

> But note thata even if this reset path is taken, we should still have
> at least the default ->snd_cwnd value of 2.

Right, it wasn't be uninitialized as we get that 2 from elsewhere.

A patch below.

-- 
[PATCH] tcp: fix >2 iw selection

A long-standing feature in tcp_init_metrics() is such that
any of its goto reset prevents call to tcp_init_cwnd().

Compile tested.

Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@...sinki.fi>
---
 net/ipv4/tcp_input.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c
index 4872524..00ba37b 100644
--- a/net/ipv4/tcp_input.c
+++ b/net/ipv4/tcp_input.c
@@ -928,6 +928,8 @@ static void tcp_init_metrics(struct sock *sk)
 	tcp_set_rto(sk);
 	if (inet_csk(sk)->icsk_rto < TCP_TIMEOUT_INIT && !tp->rx_opt.saw_tstamp)
 		goto reset;
+
+cwnd:
 	tp->snd_cwnd = tcp_init_cwnd(tp, dst);
 	tp->snd_cwnd_stamp = tcp_time_stamp;
 	return;
@@ -942,6 +944,7 @@ reset:
 		tp->mdev = tp->mdev_max = tp->rttvar = TCP_TIMEOUT_INIT;
 		inet_csk(sk)->icsk_rto = TCP_TIMEOUT_INIT;
 	}
+	goto cwnd;
 }
 
 static void tcp_update_reordering(struct sock *sk, const int metric,
-- 
1.5.2.2

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ