PERFORCE change 157797 for review

Andre Oppermann andre at FreeBSD.org
Mon Feb 16 08:13:03 PST 2009


http://perforce.freebsd.org/chv.cgi?CH=157797

Change 157797 by andre at andre_flirtbox on 2009/02/16 16:12:36

	Refine the segment size calculation in the TSO case.

Affected files ...

.. //depot/projects/tcp_new/netinet/tcp_output.c#3 edit

Differences ...

==== //depot/projects/tcp_new/netinet/tcp_output.c#3 (text+ko) ====

@@ -722,9 +722,11 @@
 	if (len + optlen + ipoptlen > tp->t_maxopd) {
 		flags &= ~TH_FIN;
 		if (tso) {
-			if (len > TCP_MAXWIN - hdrlen - optlen) {
-				len = TCP_MAXWIN - hdrlen - optlen;
-				len = len - (len % (tp->t_maxopd - optlen));
+			int hdrs =  max_linkhdr + hdrlen + optlen + ipoptlen;
+
+			if (len > TCP_MAXWIN - hdrs) {
+				len = TCP_MAXWIN - hdrs;
+				len -= len % (tp->t_maxopd - optlen);
 				sendalot = 1;
 			} else if (tp->t_flags & TF_NEEDFIN)
 				sendalot = 1;


More information about the p4-projects mailing list