From a3b4ba8e94e689f82c37549d579a51416f716969 Mon Sep 17 00:00:00 2001 From: "David S. Miller" Date: Mon, 24 Mar 2003 06:47:20 -0800 Subject: [PATCH] [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. --- net/ipv4/tcp.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/net/ipv4/tcp.c b/net/ipv4/tcp.c index 1bcb395fdd5bb..ccc7e2adc3b16 100644 --- a/net/ipv4/tcp.c +++ b/net/ipv4/tcp.c @@ -1189,7 +1189,8 @@ new_segment: from += copy; copied += copy; - seglen -= copy; + if ((seglen -= copy) == 0 && iovlen == 0) + goto out; if (skb->len != mss_now || (flags & MSG_OOB)) continue; -- 2.53.0