Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 16 Jun 2009 19:00:13 +0000 (UTC)
From:      John Baldwin <jhb@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r194304 - head/sys/netinet
Message-ID:  <200906161900.n5GJ0Dr7040960@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: jhb
Date: Tue Jun 16 19:00:12 2009
New Revision: 194304
URL: http://svn.freebsd.org/changeset/base/194304

Log:
  Fix edge cases with ticks wrapping from INT_MAX to INT_MIN in the handling
  of the per-tcpcb t_badtrxtwin.
  
  Submitted by:	bde

Modified:
  head/sys/netinet/tcp_input.c

Modified: head/sys/netinet/tcp_input.c
==============================================================================
--- head/sys/netinet/tcp_input.c	Tue Jun 16 18:58:50 2009	(r194303)
+++ head/sys/netinet/tcp_input.c	Tue Jun 16 19:00:12 2009	(r194304)
@@ -1296,7 +1296,7 @@ tcp_do_segment(struct mbuf *m, struct tc
 				 * "bad retransmit" recovery.
 				 */
 				if (tp->t_rxtshift == 1 &&
-				    ticks < tp->t_badrxtwin) {
+				    (int)(ticks - tp->t_badrxtwin) < 0) {
 					TCPSTAT_INC(tcps_sndrexmitbad);
 					tp->snd_cwnd = tp->snd_cwnd_prev;
 					tp->snd_ssthresh =
@@ -2253,7 +2253,7 @@ process_ACK:
 		 * original cwnd and ssthresh, and proceed to transmit where
 		 * we left off.
 		 */
-		if (tp->t_rxtshift == 1 && ticks < tp->t_badrxtwin) {
+		if (tp->t_rxtshift == 1 && (int)(ticks - tp->t_badrxtwin) < 0) {
 			TCPSTAT_INC(tcps_sndrexmitbad);
 			tp->snd_cwnd = tp->snd_cwnd_prev;
 			tp->snd_ssthresh = tp->snd_ssthresh_prev;



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