2
0
mirror of https://github.com/checkpoint-restore/criu synced 2025-08-31 14:25:49 +00:00

tcp: check a state in refresh_inet_sk (v2)

A socket can get fin and a state will be changed on CLOSE_WAIT,
which is not supported yet.

Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
This commit is contained in:
Andrey Vagin
2012-11-20 17:17:51 +04:00
committed by Pavel Emelyanov
parent e10829370d
commit 456413c98f

View File

@@ -54,6 +54,21 @@ static int tcp_repair_on(int fd)
static int refresh_inet_sk(struct inet_sk_desc *sk) static int refresh_inet_sk(struct inet_sk_desc *sk)
{ {
int size; int size;
struct tcp_info info;
if (dump_opt(sk->rfd, SOL_TCP, TCP_INFO, &info)) {
pr_perror("Failt to obtain TCP_INFO");
return -1;
}
switch (info.tcpi_state) {
case TCP_ESTABLISHED:
case TCP_CLOSE:
break;
default:
pr_err("Unknown state %d\n", sk->state);
return -1;
}
if (ioctl(sk->rfd, SIOCOUTQ, &size) == -1) { if (ioctl(sk->rfd, SIOCOUTQ, &size) == -1) {
pr_perror("Unable to get size of snd queue"); pr_perror("Unable to get size of snd queue");