summaryrefslogtreecommitdiff
path: root/net/ipv4/tcp.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2009-07-01 17:29:26 (GMT)
committerLinus Torvalds <torvalds@linux-foundation.org>2009-07-01 17:29:26 (GMT)
commit7b85425fac72588674d5c71604af618f690c91d7 (patch)
tree679b1df68e58b0fc9e898b688e51387591b0bdad /net/ipv4/tcp.c
parent57d81f6f393b245894ca0cd828f80ce7e3294f39 (diff)
parentf8a68e752bc4e39644843403168137663c984524 (diff)
downloadlinux-fsl-qoriq-7b85425fac72588674d5c71604af618f690c91d7.tar.xz
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6
* git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6: (31 commits) Revert "ipv4: arp announce, arp_proxy and windows ip conflict verification" igb: return PCI_ERS_RESULT_DISCONNECT on permanent error e1000e: io_error_detected callback should return PCI_ERS_RESULT_DISCONNECT e1000: return PCI_ERS_RESULT_DISCONNECT on permanent error e1000: fix unmap bug igb: fix unmap length bug ixgbe: fix unmap length bug ixgbe: Fix link capabilities during adapter resets ixgbe: Fix device capabilities of 82599 single speed fiber NICs. ixgbe: Fix SFP log messages usbnet: Remove private stats structure usbnet: Use netdev stats structure smsc95xx: Use netdev stats structure rndis_host: Use netdev stats structure net1080: Use netdev stats structure dm9601: Use netdev stats structure cdc_eem: Use netdev stats structure ipv4: Fix fib_trie rebalancing, part 3 bnx2x: Fix the behavior of ethtool when ONBOOT=no sctp: xmit sctp packet always return no route error ...
Diffstat (limited to 'net/ipv4/tcp.c')
-rw-r--r--net/ipv4/tcp.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/net/ipv4/tcp.c b/net/ipv4/tcp.c
index 17b89c5..7870a53 100644
--- a/net/ipv4/tcp.c
+++ b/net/ipv4/tcp.c
@@ -903,13 +903,17 @@ int tcp_sendmsg(struct kiocb *iocb, struct socket *sock, struct msghdr *msg,
iov++;
while (seglen > 0) {
- int copy;
+ int copy = 0;
+ int max = size_goal;
skb = tcp_write_queue_tail(sk);
+ if (tcp_send_head(sk)) {
+ if (skb->ip_summed == CHECKSUM_NONE)
+ max = mss_now;
+ copy = max - skb->len;
+ }
- if (!tcp_send_head(sk) ||
- (copy = size_goal - skb->len) <= 0) {
-
+ if (copy <= 0) {
new_segment:
/* Allocate new segment. If the interface is SG,
* allocate skb fitting to single page.
@@ -930,6 +934,7 @@ new_segment:
skb_entail(sk, skb);
copy = size_goal;
+ max = size_goal;
}
/* Try to append data to the end of skb. */
@@ -1028,7 +1033,7 @@ new_segment:
if ((seglen -= copy) == 0 && iovlen == 0)
goto out;
- if (skb->len < size_goal || (flags & MSG_OOB))
+ if (skb->len < max || (flags & MSG_OOB))
continue;
if (forced_push(tp)) {