Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 6 Sep 2011 13:41:29 GMT
From:      Catalin Nicutar <cnicutar@FreeBSD.org>
To:        Perforce Change Reviews <perforce@freebsd.org>
Subject:   PERFORCE change 198632 for review
Message-ID:  <201109061341.p86DfTn7015096@skunkworks.freebsd.org>

next in thread | raw e-mail | index | archive | help
http://p4web.freebsd.org/@@198632?ac=10

Change 198632 by cnicutar@cnicutar_cronos on 2011/09/06 13:40:44

	Attach UTO to first non-SYN segment sent so it gets retransmitted if
	needed. Done by checking the sequence and acknowledgement numbers.

Affected files ...

.. //depot/projects/soc2011/cnicutar_tcputo_9/src/sys/netinet/tcp_output.c#4 edit
.. //depot/projects/soc2011/cnicutar_tcputo_9/src/sys/netinet/tcp_var.h#8 edit

Differences ...

==== //depot/projects/soc2011/cnicutar_tcputo_9/src/sys/netinet/tcp_output.c#4 (text+ko) ====

@@ -705,17 +705,14 @@
 				to.to_sacks = (u_char *)tp->sackblks;
 			}
 		}
-		/* UTO */
-		if (tp->t_flags & TF_SND_UTO) {
+		/*
+		 * UTO. The option is sent with the SYN and with the first
+		 * non-SYN segment.
+		 */
+		if (tp->t_flags & TF_SND_UTO && (flags & TH_SYN ||
+		    FIRST_NON_SYN(tp))) {
 			to.to_uto = tp->snd_uto;
 			to.to_flags |= TOF_UTO;
-			/*
-			 * The option is sent with the SYN and with the first
-			 * non-SYN segment.
-			 */
-			if (!(flags & TH_SYN))
-				tp->t_flags &= ~TF_SND_UTO;
-
 		}
 #ifdef TCP_SIGNATURE
 		/* TCP-MD5 (RFC2385). */

==== //depot/projects/soc2011/cnicutar_tcputo_9/src/sys/netinet/tcp_var.h#8 (text+ko) ====

@@ -268,6 +268,10 @@
 #define UTO_VALUE(to)	((to).to_uto & UTO_MINS) ?	\
     ((to).to_uto & ~(UTO_MINS)) * 60 : (to).to_uto
 
+#define FIRST_NON_SYN(tp) (TCPS_HAVEESTABLISHED((tp)->t_state) && 	\
+    (tp)->snd_nxt == (tp)->iss + 1 &&					\
+    (tp)->rcv_nxt == (tp)->irs + 1)
+
 /*
  * Flags for the t_oobflags field.
  */



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