Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 22 Jan 2013 09:44:22 +0000 (UTC)
From:      Lawrence Stewart <lstewart@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r245783 - head/sys/netinet
Message-ID:  <201301220944.r0M9iMRK099130@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: lstewart
Date: Tue Jan 22 09:44:21 2013
New Revision: 245783
URL: http://svnweb.freebsd.org/changeset/base/245783

Log:
  Simplify and fix a bug in cc_ack_received()'s "are we congestion window limited"
  logic (refer to [1] for associated discussion). snd_cwnd and snd_wnd are
  unsigned long and on 64 bit hosts, min() will truncate them to 32 bits and could
  therefore potentially corrupt the result (although under normal operation,
  neither variable should legitmately exceed 32 bits).
  
  [1] http://lists.freebsd.org/pipermail/freebsd-net/2013-January/034297.html
  
  Submitted by:	jhb
  MFC after:	1 week

Modified:
  head/sys/netinet/tcp_input.c

Modified: head/sys/netinet/tcp_input.c
==============================================================================
--- head/sys/netinet/tcp_input.c	Tue Jan 22 08:09:43 2013	(r245782)
+++ head/sys/netinet/tcp_input.c	Tue Jan 22 09:44:21 2013	(r245783)
@@ -285,7 +285,7 @@ cc_ack_received(struct tcpcb *tp, struct
 	INP_WLOCK_ASSERT(tp->t_inpcb);
 
 	tp->ccv->bytes_this_ack = BYTES_THIS_ACK(tp, th);
-	if (tp->snd_cwnd == min(tp->snd_cwnd, tp->snd_wnd))
+	if (tp->snd_cwnd <= tp->snd_wnd)
 		tp->ccv->flags |= CCF_CWND_LIMITED;
 	else
 		tp->ccv->flags &= ~CCF_CWND_LIMITED;



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201301220944.r0M9iMRK099130>