Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 5 Jul 2017 16:10:30 +0000 (UTC)
From:      "Jonathan T. Looney" <jtl@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r320682 - head/sys/netinet
Message-ID:  <201707051610.v65GAUfY081088@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: jtl
Date: Wed Jul  5 16:10:30 2017
New Revision: 320682
URL: https://svnweb.freebsd.org/changeset/base/320682

Log:
  Don't overpromote values when calculating len in tcp_output().
  
  sbavail() returns u_int and sendwin is a uint32_t. Therefore, min() (which
  operates on two u_int values) is able to correctly calculate the minimum
  of these two arguments.
  
  Reported by:	rrs
  MFC after:	1 week
  Sponsored by:	Netflix

Modified:
  head/sys/netinet/tcp_output.c

Modified: head/sys/netinet/tcp_output.c
==============================================================================
--- head/sys/netinet/tcp_output.c	Wed Jul  5 15:59:52 2017	(r320681)
+++ head/sys/netinet/tcp_output.c	Wed Jul  5 16:10:30 2017	(r320682)
@@ -386,7 +386,7 @@ after_sack_rexmit:
 	 */
 	if (sack_rxmit == 0) {
 		if (sack_bytes_rxmt == 0)
-			len = ((int32_t)ulmin(sbavail(&so->so_snd), sendwin) -
+			len = ((int32_t)min(sbavail(&so->so_snd), sendwin) -
 			    off);
 		else {
 			int32_t cwin;



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