When doing TSO correctly do the check to prevent a maximum sized IP packet

from overflowing.
This commit is contained in:
Andre Oppermann 2006-09-28 13:59:26 +00:00
parent 481544f3ae
commit 6a2257d911

View File

@ -739,7 +739,7 @@ send:
if (len + optlen + ipoptlen > tp->t_maxopd) {
flags &= ~TH_FIN;
if (tso) {
if (len > TCP_MAXWIN) {
if (len > TCP_MAXWIN - hdrlen) {
len = TCP_MAXWIN - hdrlen;
len = len - (len % (tp->t_maxopd - optlen));
sendalot = 1;