[<prev] [next>] [day] [month] [year] [list]
Message-ID: <4EFB1C48.7060407@parallels.com>
Date: Wed, 28 Dec 2011 17:40:24 +0400
From: Pavel Emelyanov <xemul@...allels.com>
To: David Miller <davem@...emloft.net>,
Linux Netdev List <netdev@...r.kernel.org>
Subject: [PATCH 5/5] unix_diag: Report ack backlog info for listen sockets
I propose to reuse the MEMINFO bit and message for this, since it's
a) also 2 values
b) symmetrical to how inet diag reports the length
Is it OK, or is it better to introduce separate bit and message?
Signed-off-by: Pavel Emelyanov <xemul@...allels.com>
---
net/unix/diag.c | 10 ++++++++--
1 files changed, 8 insertions(+), 2 deletions(-)
diff --git a/net/unix/diag.c b/net/unix/diag.c
index dbae8a4..ebec5fc 100644
--- a/net/unix/diag.c
+++ b/net/unix/diag.c
@@ -113,8 +113,14 @@ static int sk_diag_show_meminfo(struct sock *sk, struct sk_buff *nlskb)
struct unix_diag_meminfo *mi;
mi = UNIX_DIAG_PUT(nlskb, UNIX_DIAG_MEMINFO, sizeof(*mi));
- mi->udiag_len = sk_wmem_alloc_get(sk);
- mi->udiag_limit = sk->sk_sndbuf;
+
+ if (sk->sk_state == TCP_LISTEN) {
+ mi->udiag_len = sk->sk_receive_queue.qlen;
+ mi->udiag_limit = sk->sk_max_ack_backlog;
+ } else {
+ mi->udiag_len = sk_wmem_alloc_get(sk);
+ mi->udiag_limit = sk->sk_sndbuf;
+ }
return 0;
--
1.5.5.6
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists