svn commit: r320682 - head/sys/netinet

Jonathan T. Looney jtl at FreeBSD.org
Wed Jul 5 16:10:31 UTC 2017


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;


More information about the svn-src-all mailing list