summaryrefslogtreecommitdiff
path: root/sys/netinet/tcp_output.c
diff options
context:
space:
mode:
authorAndre Oppermann <andre@FreeBSD.org>2006-09-15 16:08:09 +0000
committerAndre Oppermann <andre@FreeBSD.org>2006-09-15 16:08:09 +0000
commit31ecb34a4e0af756119a23a5715a284a9ce8e703 (patch)
tree41ed3bfc9e6442904a2985518857f2126815d962 /sys/netinet/tcp_output.c
parent7f01dc25c42c02e2c282c71aa1237187c9606a68 (diff)
Notes
Diffstat (limited to 'sys/netinet/tcp_output.c')
-rw-r--r--sys/netinet/tcp_output.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/sys/netinet/tcp_output.c b/sys/netinet/tcp_output.c
index 986f9566db11..dc67a5d65efe 100644
--- a/sys/netinet/tcp_output.c
+++ b/sys/netinet/tcp_output.c
@@ -730,16 +730,18 @@ send:
* Clear the FIN bit because we cut off the tail of
* the segment.
*
- * When doing TSO limit a burst to TCP_MAXWIN and set the
- * flag to continue sending and prevent the last segment
- * from being fractional thus making them all equal sized.
+ * When doing TSO limit a burst to TCP_MAXWIN minus the
+ * IP, TCP and Options length to keep ip->ip_len from
+ * overflowing. Prevent the last segment from being
+ * fractional thus making them all equal sized and set
+ * the flag to continue sending.
*/
if (len + optlen + ipoptlen > tp->t_maxopd) {
flags &= ~TH_FIN;
if (tso) {
if (len > TCP_MAXWIN) {
- len = TCP_MAXWIN - TCP_MAXWIN %
- (tp->t_maxopd - optlen);
+ len = TCP_MAXWIN - hdrlen;
+ len = len - (len % (tp->t_maxopd - optlen));
sendalot = 1;
} else if (tp->t_flags & TF_NEEDFIN)
sendalot = 1;