mirror of
https://github.com/checkpoint-restore/criu
synced 2025-08-31 22:35:33 +00:00
tcp: add support for synsent
libsoccr knows how to restore these sockets. travis-ci: success for series starting with [01/21] build: install libnet-dev Signed-off-by: Andrei Vagin <avagin@virtuozzo.com> Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
This commit is contained in:
committed by
Pavel Emelyanov
parent
5cb2893f0e
commit
f0f2496da0
@@ -170,6 +170,7 @@ static int can_dump_inet_sk(const struct inet_sk_desc *sk)
|
|||||||
case TCP_CLOSE_WAIT:
|
case TCP_CLOSE_WAIT:
|
||||||
case TCP_LAST_ACK:
|
case TCP_LAST_ACK:
|
||||||
case TCP_CLOSING:
|
case TCP_CLOSING:
|
||||||
|
case TCP_SYN_SENT:
|
||||||
if (!opts.tcp_established_ok) {
|
if (!opts.tcp_established_ok) {
|
||||||
pr_err("Connected TCP socket, consider using --%s option.\n",
|
pr_err("Connected TCP socket, consider using --%s option.\n",
|
||||||
SK_EST_PARAM);
|
SK_EST_PARAM);
|
||||||
|
@@ -350,10 +350,14 @@ static int restore_tcp_conn_state(int sk, struct libsoccr_sk *socr, struct inet_
|
|||||||
|
|
||||||
(void)data;
|
(void)data;
|
||||||
|
|
||||||
if (libsoccr_set_sk_data_noq(socr, &data, sizeof(data)))
|
/*
|
||||||
|
* O_NONBLOCK has to be set before libsoccr_set_sk_data_noq(),
|
||||||
|
* it is required to restore syn-sent sockets.
|
||||||
|
*/
|
||||||
|
if (restore_prepare_socket(sk))
|
||||||
goto err_c;
|
goto err_c;
|
||||||
|
|
||||||
if (restore_prepare_socket(sk))
|
if (libsoccr_set_sk_data_noq(socr, &data, sizeof(data)))
|
||||||
goto err_c;
|
goto err_c;
|
||||||
|
|
||||||
if (restore_tcp_queues(socr, &data, img))
|
if (restore_tcp_queues(socr, &data, img))
|
||||||
|
@@ -648,7 +648,7 @@ int collect_sockets(struct ns_id *ns)
|
|||||||
req.r.i.idiag_states = (1 << TCP_LISTEN) | (1 << TCP_ESTABLISHED) |
|
req.r.i.idiag_states = (1 << TCP_LISTEN) | (1 << TCP_ESTABLISHED) |
|
||||||
(1 << TCP_FIN_WAIT1) | (1 << TCP_FIN_WAIT2) |
|
(1 << TCP_FIN_WAIT1) | (1 << TCP_FIN_WAIT2) |
|
||||||
(1 << TCP_CLOSE_WAIT) | (1 << TCP_LAST_ACK) |
|
(1 << TCP_CLOSE_WAIT) | (1 << TCP_LAST_ACK) |
|
||||||
(1 << TCP_CLOSING);
|
(1 << TCP_CLOSING) | (1 << TCP_SYN_SENT);
|
||||||
tmp = do_collect_req(nl, &req, sizeof(req), inet_receive_one, &req.r.i);
|
tmp = do_collect_req(nl, &req, sizeof(req), inet_receive_one, &req.r.i);
|
||||||
if (tmp)
|
if (tmp)
|
||||||
err = tmp;
|
err = tmp;
|
||||||
@@ -679,7 +679,7 @@ int collect_sockets(struct ns_id *ns)
|
|||||||
req.r.i.idiag_states = (1 << TCP_LISTEN) | (1 << TCP_ESTABLISHED) |
|
req.r.i.idiag_states = (1 << TCP_LISTEN) | (1 << TCP_ESTABLISHED) |
|
||||||
(1 << TCP_FIN_WAIT1) | (1 << TCP_FIN_WAIT2) |
|
(1 << TCP_FIN_WAIT1) | (1 << TCP_FIN_WAIT2) |
|
||||||
(1 << TCP_CLOSE_WAIT) | (1 << TCP_LAST_ACK) |
|
(1 << TCP_CLOSE_WAIT) | (1 << TCP_LAST_ACK) |
|
||||||
(1 << TCP_CLOSING);
|
(1 << TCP_CLOSING) | (1 << TCP_SYN_SENT);
|
||||||
tmp = do_collect_req(nl, &req, sizeof(req), inet_receive_one, &req.r.i);
|
tmp = do_collect_req(nl, &req, sizeof(req), inet_receive_one, &req.r.i);
|
||||||
if (tmp)
|
if (tmp)
|
||||||
err = tmp;
|
err = tmp;
|
||||||
|
Reference in New Issue
Block a user