Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 22 Jul 2015 15:05:46 +0000 (UTC)
From:      Hiren Panchasara <hiren@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org
Subject:   svn commit: r285793 - stable/10/sys/netinet
Message-ID:  <201507221505.t6MF5kIG092911@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: hiren
Date: Wed Jul 22 15:05:45 2015
New Revision: 285793
URL: https://svnweb.freebsd.org/changeset/base/285793

Log:
  MFC r284941:
  Avoid a situation where we do not set persist timer after a zero window
  condition.
  If you send a 0-length packet, but there is data is the socket buffer, and
  neither the rexmt or persist timer is already set, then activate the persist
  timer.
  
  PR:		192599
  Approved by:	re (delphij)

Modified:
  stable/10/sys/netinet/tcp_output.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/netinet/tcp_output.c
==============================================================================
--- stable/10/sys/netinet/tcp_output.c	Wed Jul 22 11:30:37 2015	(r285792)
+++ stable/10/sys/netinet/tcp_output.c	Wed Jul 22 15:05:45 2015	(r285793)
@@ -1397,6 +1397,30 @@ timer:
 				tp->t_rxtshift = 0;
 			}
 			tcp_timer_activate(tp, TT_REXMT, tp->t_rxtcur);
+		} else if (len == 0 && so->so_snd.sb_cc &&
+		    !tcp_timer_active(tp, TT_REXMT) &&
+		    !tcp_timer_active(tp, TT_PERSIST)) {
+			/*
+			 * Avoid a situation where we do not set persist timer
+			 * after a zero window condition. For example:
+			 * 1) A -> B: packet with enough data to fill the window
+			 * 2) B -> A: ACK for #1 + new data (0 window
+			 *    advertisement)
+			 * 3) A -> B: ACK for #2, 0 len packet
+			 *
+			 * In this case, A will not activate the persist timer,
+			 * because it chose to send a packet. Unless tcp_output
+			 * is called for some other reason (delayed ack timer,
+			 * another input packet from B, socket syscall), A will
+			 * not send zero window probes.
+			 *
+			 * So, if you send a 0-length packet, but there is data
+			 * in the socket buffer, and neither the rexmt or
+			 * persist timer is already set, then activate the
+			 * persist timer.
+			 */
+			tp->t_rxtshift = 0;
+			tcp_setpersist(tp);
 		}
 	} else {
 		/*



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