Commit 196ce521 authored by Cyrill Gorcunov's avatar Cyrill Gorcunov

sockets: unix -- Retrieve backlog length for stream sockets

Signed-off-by: 's avatarCyrill Gorcunov <gorcunov@openvz.org>
parent 34b2ba0c
...@@ -46,6 +46,7 @@ struct unix_sk_desc { ...@@ -46,6 +46,7 @@ struct unix_sk_desc {
unsigned int state; unsigned int state;
unsigned int peer_ino; unsigned int peer_ino;
unsigned int rqlen; unsigned int rqlen;
unsigned int wqlen;
unsigned int namelen; unsigned int namelen;
char *name; char *name;
unsigned int *icons; unsigned int *icons;
...@@ -143,7 +144,6 @@ static int can_dump_unix_sk(struct unix_sk_desc *sk) ...@@ -143,7 +144,6 @@ static int can_dump_unix_sk(struct unix_sk_desc *sk)
return 1; return 1;
} }
#define USK_DEF_BACKLOG 16
static int dump_one_unix(struct socket_desc *_sk, char *fd, struct cr_fdset *cr_fdset) static int dump_one_unix(struct socket_desc *_sk, char *fd, struct cr_fdset *cr_fdset)
{ {
struct unix_sk_desc *sk = (struct unix_sk_desc *)_sk; struct unix_sk_desc *sk = (struct unix_sk_desc *)_sk;
...@@ -157,7 +157,7 @@ static int dump_one_unix(struct socket_desc *_sk, char *fd, struct cr_fdset *cr_ ...@@ -157,7 +157,7 @@ static int dump_one_unix(struct socket_desc *_sk, char *fd, struct cr_fdset *cr_
ue.type = sk->type; ue.type = sk->type;
ue.state = sk->state; ue.state = sk->state;
ue.namelen = sk->namelen; ue.namelen = sk->namelen;
ue.backlog = USK_DEF_BACKLOG; /* FIXME */ ue.backlog = sk->wqlen;
ue.pad = 0; ue.pad = 0;
ue.peer = sk->peer_ino; ue.peer = sk->peer_ino;
...@@ -284,8 +284,13 @@ static int unix_collect_one(struct unix_diag_msg *m, struct rtattr **tb) ...@@ -284,8 +284,13 @@ static int unix_collect_one(struct unix_diag_msg *m, struct rtattr **tb)
d->icons[len / sizeof(u32)] = 0; d->icons[len / sizeof(u32)] = 0;
} }
if (tb[UNIX_DIAG_RQLEN]) if (tb[UNIX_DIAG_RQLEN]) {
d->rqlen = *(int *)RTA_DATA(tb[UNIX_DIAG_RQLEN]); struct unix_diag_rqlen *rq;
rq = (struct unix_diag_rqlen *)RTA_DATA(tb[UNIX_DIAG_RQLEN]);
d->rqlen = rq->udiag_rqueue;
d->wqlen = rq->udiag_wqueue;
}
show_one_unix("Collected", d); show_one_unix("Collected", d);
......
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