aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv4/tcp_output.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/ipv4/tcp_output.c')
-rw-r--r--net/ipv4/tcp_output.c33
1 files changed, 9 insertions, 24 deletions
diff --git a/net/ipv4/tcp_output.c b/net/ipv4/tcp_output.c
index d46f2143305c..672854664ff5 100644
--- a/net/ipv4/tcp_output.c
+++ b/net/ipv4/tcp_output.c
@@ -850,15 +850,15 @@ static int tcp_transmit_skb(struct sock *sk, struct sk_buff *skb, int clone_it,
850 850
851 BUG_ON(!skb || !tcp_skb_pcount(skb)); 851 BUG_ON(!skb || !tcp_skb_pcount(skb));
852 852
853 /* If congestion control is doing timestamping, we must 853 if (clone_it) {
854 * take such a timestamp before we potentially clone/copy.
855 */
856 if (icsk->icsk_ca_ops->flags & TCP_CONG_RTT_STAMP)
857 __net_timestamp(skb);
858
859 if (likely(clone_it)) {
860 const struct sk_buff *fclone = skb + 1; 854 const struct sk_buff *fclone = skb + 1;
861 855
856 /* If congestion control is doing timestamping, we must
857 * take such a timestamp before we potentially clone/copy.
858 */
859 if (icsk->icsk_ca_ops->flags & TCP_CONG_RTT_STAMP)
860 __net_timestamp(skb);
861
862 if (unlikely(skb->fclone == SKB_FCLONE_ORIG && 862 if (unlikely(skb->fclone == SKB_FCLONE_ORIG &&
863 fclone->fclone == SKB_FCLONE_CLONE)) 863 fclone->fclone == SKB_FCLONE_CLONE))
864 NET_INC_STATS_BH(sock_net(sk), 864 NET_INC_STATS_BH(sock_net(sk),
@@ -2353,21 +2353,6 @@ int __tcp_retransmit_skb(struct sock *sk, struct sk_buff *skb)
2353 2353
2354 tcp_retrans_try_collapse(sk, skb, cur_mss); 2354 tcp_retrans_try_collapse(sk, skb, cur_mss);
2355 2355
2356 /* Some Solaris stacks overoptimize and ignore the FIN on a
2357 * retransmit when old data is attached. So strip it off
2358 * since it is cheap to do so and saves bytes on the network.
2359 */
2360 if (skb->len > 0 &&
2361 (TCP_SKB_CB(skb)->tcp_flags & TCPHDR_FIN) &&
2362 tp->snd_una == (TCP_SKB_CB(skb)->end_seq - 1)) {
2363 if (!pskb_trim(skb, 0)) {
2364 /* Reuse, even though it does some unnecessary work */
2365 tcp_init_nondata_skb(skb, TCP_SKB_CB(skb)->end_seq - 1,
2366 TCP_SKB_CB(skb)->tcp_flags);
2367 skb->ip_summed = CHECKSUM_NONE;
2368 }
2369 }
2370
2371 /* Make a copy, if the first transmission SKB clone we made 2356 /* Make a copy, if the first transmission SKB clone we made
2372 * is still in somebody's hands, else make a clone. 2357 * is still in somebody's hands, else make a clone.
2373 */ 2358 */
@@ -2736,8 +2721,8 @@ struct sk_buff *tcp_make_synack(struct sock *sk, struct dst_entry *dst,
2736 th->syn = 1; 2721 th->syn = 1;
2737 th->ack = 1; 2722 th->ack = 1;
2738 TCP_ECN_make_synack(req, th); 2723 TCP_ECN_make_synack(req, th);
2739 th->source = ireq->loc_port; 2724 th->source = htons(ireq->ir_num);
2740 th->dest = ireq->rmt_port; 2725 th->dest = ireq->ir_rmt_port;
2741 /* Setting of flags are superfluous here for callers (and ECE is 2726 /* Setting of flags are superfluous here for callers (and ECE is
2742 * not even correctly set) 2727 * not even correctly set)
2743 */ 2728 */