Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 7 Jul 2011 07:43:33 GMT
From:      Catalin Nicutar <cnicutar@FreeBSD.org>
To:        Perforce Change Reviews <perforce@freebsd.org>
Subject:   PERFORCE change 195838 for review
Message-ID:  <201107070743.p677hXv9011148@skunkworks.freebsd.org>

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

Change 195838 by cnicutar@cnicutar_cronos on 2011/07/07 07:43:12

	Send UTO on SYN and on the first non-SYN segment sent (as advised
	by RFC 5482, sections 3 and 4.1).

Affected files ...

.. //depot/projects/soc2011/cnicutar_tcputo_8/src/sys/netinet/tcp_output.c#6 edit
.. //depot/projects/soc2011/cnicutar_tcputo_8/src/sys/netinet/tcp_timer.c#5 edit

Differences ...

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

@@ -705,9 +705,16 @@
 			}
 		}
 		/* UTO */
-		if ((flags & TH_SYN) && (tp->t_flags & TF_SND_UTO)) {
+		if (tp->t_flags & TF_SND_UTO) {
 			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_8/src/sys/netinet/tcp_timer.c#5 (text+ko) ====

@@ -305,8 +305,7 @@
 		return;
 	}
 	callout_deactivate(&tp->t_timers->tt_keep);
-	if ((tp->t_flags & TF_SND_UTO) || ((tp->t_flags & TF_RCV_UTO) &&
-	    tp->rcv_uto)) {
+	if ((tp->snd_uto) || ((tp->t_flags & TF_RCV_UTO) && tp->rcv_uto)) {
 		/*
 		 * This connection is using UTO (either sending or has
 		 * received a value). We need to stop sending keepalives
@@ -493,8 +492,7 @@
 		/* UTO starting again since it's the first retransmit. */
 		tp->t_suto = 0;	
 
-	if ((tp->t_flags & TF_SND_UTO) || ((tp->t_flags & TF_RCV_UTO) &&
-	    tp->rcv_uto)) {
+	if (tp->snd_uto || ((tp->t_flags & TF_RCV_UTO) && tp->rcv_uto)) {
 		/*
 		 * Since we're using UTO for this connection we need to
 		 * compute how much time we've got left.



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