Commit a3b4ba8e authored by David S. Miller's avatar David S. Miller

[TCP]: Forward port of 2.4.x bugfix, noticed as missing by davej@codemonkey.org.uk.

In tcp_sendmsg, make sure we jump to the out label
when seglen is decremented to zero and no more iovecs remain.
This matches the do_tcp_sendpages logic and makes sure that
PSH is set correctly at the end of a write even if the write length
equals the current mss.
parent 7d34d214
...@@ -1189,7 +1189,8 @@ int tcp_sendmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *msg, ...@@ -1189,7 +1189,8 @@ int tcp_sendmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *msg,
from += copy; from += copy;
copied += copy; copied += copy;
seglen -= copy; if ((seglen -= copy) == 0 && iovlen == 0)
goto out;
if (skb->len != mss_now || (flags & MSG_OOB)) if (skb->len != mss_now || (flags & MSG_OOB))
continue; continue;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment