Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 15 Apr 2011 20:42:27 +0000 (UTC)
From:      John Baldwin <jhb@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
Subject:   svn commit: r220679 - stable/8/sys/netinet
Message-ID:  <201104152042.p3FKgRqI081721@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: jhb
Date: Fri Apr 15 20:42:27 2011
New Revision: 220679
URL: http://svn.freebsd.org/changeset/base/220679

Log:
  MFC 220156:
  Clamp the initial advertised receive window when responding to a SYN/ACK
  to the maximum allowed window.  Growing the window too large would cause
  an underflow in the calculations in tcp_output() to decide if a window
  update should be sent which would prevent the persist timer from being
  started if data was pending and the other end of the connection advertised
  an initial window size of 0.

Modified:
  stable/8/sys/netinet/tcp_input.c
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)

Modified: stable/8/sys/netinet/tcp_input.c
==============================================================================
--- stable/8/sys/netinet/tcp_input.c	Fri Apr 15 20:42:14 2011	(r220678)
+++ stable/8/sys/netinet/tcp_input.c	Fri Apr 15 20:42:27 2011	(r220679)
@@ -1558,7 +1558,8 @@ tcp_do_segment(struct mbuf *m, struct tc
 				(TF_RCVD_SCALE|TF_REQ_SCALE)) {
 				tp->rcv_scale = tp->request_r_scale;
 			}
-			tp->rcv_adv += tp->rcv_wnd;
+			tp->rcv_adv += imin(tp->rcv_wnd,
+			    TCP_MAXWIN << tp->rcv_scale);
 			tp->snd_una++;		/* SYN is acked */
 			/*
 			 * If there's data, delay ACK; if there's also a FIN



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