Commit cb7948d9 authored by Andrei Vagin's avatar Andrei Vagin Committed by Pavel Emelyanov

inet: dump actual states of tcp sockets

We get sockets from task_diag, then we block network and dump sockets.

A socket state can be changed between first two steps, so lets get
a socket state on the third step and dump it.

travis-ci: success for series starting with [01/21] build: install libnet-dev
Signed-off-by: 's avatarAndrei Vagin <avagin@virtuozzo.com>
Signed-off-by: 's avatarPavel Emelyanov <xemul@virtuozzo.com>
parent beb57e95
......@@ -304,7 +304,6 @@ static int do_dump_one_inet_fd(int lfd, u32 id, const struct fd_parms *p, int fa
ie.family = family;
ie.proto = proto;
ie.type = sk->type;
ie.state = sk->state;
ie.src_port = sk->src_port;
ie.dst_port = sk->dst_port;
ie.backlog = sk->wqlen;
......@@ -365,9 +364,6 @@ static int do_dump_one_inet_fd(int lfd, u32 id, const struct fd_parms *p, int fa
if (dump_socket_opts(lfd, &skopts))
goto err;
if (pb_write_one(img_from_set(glob_imgset, CR_FD_INETSK), &ie, PB_INET_SK))
goto err;
pr_info("Dumping inet socket at %d\n", p->fd);
show_one_inet("Dumping", sk);
show_one_inet_img("Dumped", &ie);
......@@ -382,6 +378,11 @@ static int do_dump_one_inet_fd(int lfd, u32 id, const struct fd_parms *p, int fa
err = 0;
break;
}
ie.state = sk->state;
if (pb_write_one(img_from_set(glob_imgset, CR_FD_INETSK), &ie, PB_INET_SK))
goto err;
err:
release_skopts(&skopts);
xfree(ie.src_addr);
......
......@@ -132,6 +132,8 @@ static int dump_tcp_conn_state(struct inet_sk_desc *sk)
goto err_r;
}
sk->state = data.state;
tse.inq_len = data.inq_len;
tse.inq_seq = data.inq_seq;
tse.outq_len = data.outq_len;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment