Commit bf8b7c4f authored by Pavel Emelyanov's avatar Pavel Emelyanov

inet: Reshuffle proto-level socket dumping

We'll support other tcp states and udp-specific info eventually.
This introduced switch() looks more friendly to this future.
Signed-off-by: 's avatarPavel Emelyanov <xemul@parallels.com>
parent 8abab0da
......@@ -293,10 +293,14 @@ static int do_dump_one_inet_fd(int lfd, u32 id, const struct fd_parms *p, int fa
show_one_inet_img("Dumped", &ie);
sk->sd.already_dumped = 1;
if (tcp_connection(sk))
switch (sk->proto) {
case IPPROTO_TCP:
ret = dump_one_tcp(lfd, sk);
else
break;
default:
ret = 0;
break;
}
err:
xfree(ie.src_addr);
xfree(ie.dst_addr);
......
......@@ -298,6 +298,9 @@ err_in:
int dump_one_tcp(int fd, struct inet_sk_desc *sk)
{
if (sk->state != TCP_ESTABLISHED)
return 0;
pr_info("Dumping TCP connection\n");
if (tcp_repair_establised(fd, sk))
......
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