diff options
author | Alex Shi <alex.shi@linaro.org> | 2017-11-22 12:02:16 +0800 |
---|---|---|
committer | Alex Shi <alex.shi@linaro.org> | 2017-11-22 12:02:16 +0800 |
commit | d5aff662273133ff050acb8cac683d5f73c5fbf3 (patch) | |
tree | 09d9125af1e6a23f8bd3e5e9015227d2f2419e34 /net | |
parent | 0ea55536529fc02ed506f2b5885c061e6c26be7c (diff) | |
parent | 563c24f65f4fb009047cf4702dd16c7c592fd2b2 (diff) |
Merge tag 'v4.9.64' into linux-linaro-lsk-v4.9
This is the 4.9.64 stable release
Diffstat (limited to 'net')
-rw-r--r-- | net/ipv4/tcp.c | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/net/ipv4/tcp.c b/net/ipv4/tcp.c index 6b3d27e50317..dd33c785ce16 100644 --- a/net/ipv4/tcp.c +++ b/net/ipv4/tcp.c @@ -431,7 +431,7 @@ EXPORT_SYMBOL(tcp_init_sock); static void tcp_tx_timestamp(struct sock *sk, u16 tsflags, struct sk_buff *skb) { - if (tsflags) { + if (tsflags && skb) { struct skb_shared_info *shinfo = skb_shinfo(skb); struct tcp_skb_cb *tcb = TCP_SKB_CB(skb); @@ -966,10 +966,8 @@ new_segment: copied += copy; offset += copy; size -= copy; - if (!size) { - tcp_tx_timestamp(sk, sk->sk_tsflags, skb); + if (!size) goto out; - } if (skb->len < size_goal || (flags & MSG_OOB)) continue; @@ -995,8 +993,11 @@ wait_for_memory: } out: - if (copied && !(flags & MSG_SENDPAGE_NOTLAST)) - tcp_push(sk, flags, mss_now, tp->nonagle, size_goal); + if (copied) { + tcp_tx_timestamp(sk, sk->sk_tsflags, tcp_write_queue_tail(sk)); + if (!(flags & MSG_SENDPAGE_NOTLAST)) + tcp_push(sk, flags, mss_now, tp->nonagle, size_goal); + } return copied; do_error: @@ -1289,7 +1290,6 @@ new_segment: copied += copy; if (!msg_data_left(msg)) { - tcp_tx_timestamp(sk, sockc.tsflags, skb); if (unlikely(flags & MSG_EOR)) TCP_SKB_CB(skb)->eor = 1; goto out; @@ -1320,8 +1320,10 @@ wait_for_memory: } out: - if (copied) + if (copied) { + tcp_tx_timestamp(sk, sockc.tsflags, tcp_write_queue_tail(sk)); tcp_push(sk, flags, mss_now, tp->nonagle, size_goal); + } out_nopush: release_sock(sk); return copied + copied_syn; |