aboutsummaryrefslogtreecommitdiffstats
path: root/net/unix/diag.c
diff options
context:
space:
mode:
authorPavel Emelyanov <xemul@parallels.com>2011-12-29 19:54:39 -0500
committerDavid S. Miller <davem@davemloft.net>2011-12-30 16:46:02 -0500
commitc9da99e6475f92653139e43f3c30c0cd011a0fd8 (patch)
treed78e4097afdcba4a3a4dd2303cc8bd475331b75a /net/unix/diag.c
parent885ee74d5d3058e4a904671ed7929c9540c95fa5 (diff)
unix_diag: Fixup RQLEN extension report
While it's not too late fix the recently added RQLEN diag extension to report rqlen and wqlen in the same way as TCP does. I.e. for listening sockets the ack backlog length (which is the input queue length for socket) in rqlen and the max ack backlog length in wqlen, and what the CINQ/OUTQ ioctls do for established. Signed-off-by: Pavel Emelyanov <xemul@parallels.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/unix/diag.c')
-rw-r--r--net/unix/diag.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/net/unix/diag.c b/net/unix/diag.c
index 98945f29da4f..6b7697fd911b 100644
--- a/net/unix/diag.c
+++ b/net/unix/diag.c
@@ -101,7 +101,18 @@ rtattr_failure:
101 101
102static int sk_diag_show_rqlen(struct sock *sk, struct sk_buff *nlskb) 102static int sk_diag_show_rqlen(struct sock *sk, struct sk_buff *nlskb)
103{ 103{
104 RTA_PUT_U32(nlskb, UNIX_DIAG_RQLEN, sk->sk_receive_queue.qlen); 104 struct unix_diag_rqlen *rql;
105
106 rql = UNIX_DIAG_PUT(nlskb, UNIX_DIAG_RQLEN, sizeof(*rql));
107
108 if (sk->sk_state == TCP_LISTEN) {
109 rql->udiag_rqueue = sk->sk_receive_queue.qlen;
110 rql->udiag_wqueue = sk->sk_max_ack_backlog;
111 } else {
112 rql->udiag_rqueue = (__u32)unix_inq_len(sk);
113 rql->udiag_wqueue = (__u32)unix_outq_len(sk);
114 }
115
105 return 0; 116 return 0;
106 117
107rtattr_failure: 118rtattr_failure: