Skip to content

Commit

Permalink
tcp: set timestamps for restored skb-s
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
avagin authored and davem330 committed Aug 20, 2013
1 parent 49baea8 commit 7ed5c5a
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions net/ipv4/tcp.c
Original file line number Diff line number Diff line change
Expand Up @@ -1120,6 +1120,13 @@ int tcp_sendmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *msg,
if (!skb)
goto wait_for_memory;

/*
* All packets are restored as if they have
* already been sent.
*/
if (tp->repair)
TCP_SKB_CB(skb)->when = tcp_time_stamp;

/*
* Check whether we can use HW checksum.
*/
Expand Down

0 comments on commit 7ed5c5a

Please sign in to comment.