Skip to content

Commit 10a8198

Browse files
edumazetdavem330
authored andcommitted
tcp: refresh skb timestamp at retransmit time
In the very unlikely case __tcp_retransmit_skb() can not use the cloning done in tcp_transmit_skb(), we need to refresh skb_mstamp before doing the copy and transmit, otherwise TCP TS val will be an exact copy of original transmit. Fixes: 7faee5c ("tcp: remove TCP_SKB_CB(skb)->when") Signed-off-by: Eric Dumazet <[email protected]> Cc: Yuchung Cheng <[email protected]> Acked-by: Yuchung Cheng <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 3b0d190 commit 10a8198

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

net/ipv4/tcp_output.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2640,8 +2640,10 @@ int __tcp_retransmit_skb(struct sock *sk, struct sk_buff *skb)
26402640
*/
26412641
if (unlikely((NET_IP_ALIGN && ((unsigned long)skb->data & 3)) ||
26422642
skb_headroom(skb) >= 0xFFFF)) {
2643-
struct sk_buff *nskb = __pskb_copy(skb, MAX_TCP_HEADER,
2644-
GFP_ATOMIC);
2643+
struct sk_buff *nskb;
2644+
2645+
skb_mstamp_get(&skb->skb_mstamp);
2646+
nskb = __pskb_copy(skb, MAX_TCP_HEADER, GFP_ATOMIC);
26452647
err = nskb ? tcp_transmit_skb(sk, nskb, 0, GFP_ATOMIC) :
26462648
-ENOBUFS;
26472649
} else {

0 commit comments

Comments
 (0)