Skip to content

Commit 7ed5c5a

Browse files
avagindavem330
authored andcommitted
tcp: set timestamps for restored skb-s
When the repair mode is turned off, the write queue seqs are updated so that the whole queue is considered to be 'already sent. The "when" field must be set for such skb. It's used in tcp_rearm_rto for example. If the "when" field isn't set, the retransmit timeout can be calculated incorrectly and a tcp connected can stop for two minutes (TCP_RTO_MAX). Acked-by: Pavel Emelyanov <[email protected]> Cc: "David S. Miller" <[email protected]> Cc: Alexey Kuznetsov <[email protected]> Cc: James Morris <[email protected]> Cc: Hideaki YOSHIFUJI <[email protected]> Cc: Patrick McHardy <[email protected]> Signed-off-by: Andrey Vagin <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 49baea8 commit 7ed5c5a

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

net/ipv4/tcp.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1120,6 +1120,13 @@ int tcp_sendmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *msg,
11201120
if (!skb)
11211121
goto wait_for_memory;
11221122

1123+
/*
1124+
* All packets are restored as if they have
1125+
* already been sent.
1126+
*/
1127+
if (tp->repair)
1128+
TCP_SKB_CB(skb)->when = tcp_time_stamp;
1129+
11231130
/*
11241131
* Check whether we can use HW checksum.
11251132
*/

0 commit comments

Comments
 (0)