[CRIU] [PATCH 1/2] tcp: Move refresh routine into dump one

Pavel Emelyanov xemul at virtuozzo.com
Tue Mar 29 12:50:32 PDT 2016


This is prerequisite for the next patch and, actually, for the libsoccr :)

Signed-off-by: Pavel Emelyanov <xemul at virtuozzo.com>
---
 criu/sk-tcp.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/criu/sk-tcp.c b/criu/sk-tcp.c
index 7a60831..66ca708 100644
--- a/criu/sk-tcp.c
+++ b/criu/sk-tcp.c
@@ -145,11 +145,6 @@ static int tcp_repair_establised(int fd, struct inet_sk_desc *sk)
 		goto err3;
 
 	list_add_tail(&sk->rlist, &cpt_tcp_repair_sockets);
-
-	ret = refresh_inet_sk(sk);
-	if (ret < 0)
-		goto err1;
-
 	return 0;
 
 err3:
@@ -322,6 +317,10 @@ static int dump_tcp_conn_state(struct inet_sk_desc *sk)
 	TcpStreamEntry tse = TCP_STREAM_ENTRY__INIT;
 	char *in_buf, *out_buf;
 
+	ret = refresh_inet_sk(sk);
+	if (ret < 0)
+		goto err_r;
+
 	/*
 	 * Read queue
 	 */
@@ -408,6 +407,7 @@ err_opt:
 err_out:
 	xfree(in_buf);
 err_in:
+err_r:
 	return ret;
 }
 
-- 
2.5.0


More information about the CRIU mailing list