[CRIU] [PATCH] tcp: initialize rcv_tstamp for restored sockets

Andrey Vagin avagin at openvz.org
Tue Aug 20 02:50:43 EDT 2013


From: Andrew Vagin <avagin at openvz.org>

u32 rcv_tstamp;     /* timestamp of last received ACK */

Its value used in tcp_retransmit_timer and if the last ack was received
more then TCP_RTO_MAX ago, the socket will be closed.

This patch initializes rcv_tstamp to a timestamp, when a socket was
restored.

Cc: Pavel Emelyanov <xemul at parallels.com>
Reported-by: Cyrill Gorcunov <gorcunov at openvz.org>
Signed-off-by: Andrey Vagin <avagin at openvz.org>
---
 net/ipv4/tcp_output.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/net/ipv4/tcp_output.c b/net/ipv4/tcp_output.c
index 92fde8d..e297299 100644
--- a/net/ipv4/tcp_output.c
+++ b/net/ipv4/tcp_output.c
@@ -2814,6 +2814,8 @@ void tcp_connect_init(struct sock *sk)
 
 	if (likely(!tp->repair))
 		tp->rcv_nxt = 0;
+	else
+		tp->rcv_tstamp = tcp_time_stamp;
 	tp->rcv_wup = tp->rcv_nxt;
 	tp->copied_seq = tp->rcv_nxt;
 
-- 
1.8.3.1



More information about the CRIU mailing list