svn commit: r242498 - user/andre/tcp_workqueue/sys/netinet

Andre Oppermann andre at FreeBSD.org
Fri Nov 2 22:17:11 UTC 2012


Author: andre
Date: Fri Nov  2 22:17:10 2012
New Revision: 242498
URL: http://svn.freebsd.org/changeset/base/242498

Log:
  Reintroduce the SACK required test in syncache_expand() but make it
  non-fatal and for informative logging only.  This way a better overview
  of real-world behavior can be gained.
  
  A previous version of this change slipped into an integrate from head.

Modified:
  user/andre/tcp_workqueue/sys/netinet/tcp_syncache.c

Modified: user/andre/tcp_workqueue/sys/netinet/tcp_syncache.c
==============================================================================
--- user/andre/tcp_workqueue/sys/netinet/tcp_syncache.c	Fri Nov  2 22:07:45 2012	(r242497)
+++ user/andre/tcp_workqueue/sys/netinet/tcp_syncache.c	Fri Nov  2 22:17:10 2012	(r242498)
@@ -991,28 +991,32 @@ syncache_expand(struct in_conninfo *inc,
 			    "rejected\n", s, __func__, th->th_seq, sc->sc_irs);
 		goto failed;
 	}
+
 	/*
-	 * If timestamps were not negotiated we don't expect them.
+	 * If timestamps were present in the SYN and we accepted
+	 * them in our SYN|ACK we require them to be present from
+	 * now on. And vice versa.
+	 *  RFC1323, Section 3.2
 	 */
-	if (!(sc->sc_flags & SCF_TIMESTAMP) && (to->to_flags & TOF_TS)) {
+	if ((sc->sc_flags & SCF_TIMESTAMP) && !(to->to_flags & TOF_TS)) {
 		if ((s = tcp_log_addrs(inc, th, NULL, NULL)))
-			log(LOG_DEBUG, "%s; %s: Timestamp not expected, "
-			    "segment rejected\n", s, __func__);
+			log(LOG_DEBUG, "%s; %s: Timestamp missing, "
+			    "rfc violation ignored\n", s, __func__);
+#if 0
 		goto failed;
+#endif
 	}
+
 	/*
-	 * If timestamps were negotiated every packet is required
-	 * to carry them.
-	 *  RFC1323, Section X
+	 * If timestamps were not negotiated we don't expect them.
 	 */
-	if ((sc->sc_flags & SCF_TIMESTAMP) && !(to->to_flags & TOF_TS)) {
+	if (!(sc->sc_flags & SCF_TIMESTAMP) && (to->to_flags & TOF_TS)) {
 		if ((s = tcp_log_addrs(inc, th, NULL, NULL)))
-			log(LOG_DEBUG, "%s; %s: Timestamp expected, "
-			    "rfc violation ignored\n", s, __func__);
-#if 0
+			log(LOG_DEBUG, "%s; %s: Timestamp not expected, "
+			    "segment rejected\n", s, __func__);
 		goto failed;
-#endif
 	}
+
 	/*
 	 * If timestamps were negotiated the reflected timestamp
 	 * must be equal to what we actually sent in the SYN|ACK.


More information about the svn-src-user mailing list