From: Pavel Emelyanov <xemul@parallels•com>
To: Stephen Hemminger <shemminger@vyatta•com>,
Linux Netdev List <netdev@vger•kernel.org>
Subject: [PATCH 4/5] ss: Get udp sockets info via sock-diag
Date: Thu, 25 Oct 2012 17:24:58 +0400 [thread overview]
Message-ID: <50893DAA.3010909@parallels.com> (raw)
In-Reply-To: <50893BAF.7030500@parallels.com>
Now everything is prepared for it, so the patch is straightforward.
Signed-off-by: Pavel Emelyanov <xemul@parallels•com>
---
misc/ss.c | 7 +++++++
1 files changed, 7 insertions(+), 0 deletions(-)
diff --git a/misc/ss.c b/misc/ss.c
index 1ceb026..a0ab2e9 100644
--- a/misc/ss.c
+++ b/misc/ss.c
@@ -1508,6 +1508,9 @@ static int tcpdiag_send(int fd, int protocol, struct filter *f)
struct rtattr rta;
struct iovec iov[3];
+ if (protocol == IPPROTO_UDP)
+ return -1;
+
memset(&nladdr, 0, sizeof(nladdr));
nladdr.nl_family = AF_NETLINK;
@@ -1976,6 +1979,10 @@ int udp_show(struct filter *f)
{
FILE *fp = NULL;
+ if (!getenv("PROC_NET_UDP") && !getenv("PROC_ROOT")
+ && inet_show_netlink(f, NULL, IPPROTO_UDP) == 0)
+ return 0;
+
dg_proto = UDP_PROTO;
if (f->families&(1<<AF_INET)) {
--
1.7.1
next prev parent reply other threads:[~2012-10-25 13:24 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-10-25 13:16 [PATCH iproute2 0/5] Teach ss to show sockets' shutdown state Pavel Emelyanov
2012-10-25 13:18 ` [PATCH 1/5] ss: Rename some tcp- names into inet- Pavel Emelyanov
2012-10-25 13:21 ` [PATCH 2/5] ss: Split inet_show_netlink into parts Pavel Emelyanov
2012-10-25 13:23 ` [PATCH 3/5] ss: Support sock-diag Pavel Emelyanov
2012-10-25 13:24 ` Pavel Emelyanov [this message]
2012-10-27 0:51 ` [PATCH 4/5] ss: Get udp sockets info via sock-diag Stephen Hemminger
2012-10-25 13:26 ` [PATCH 5/5] ss: Show inet and unix sockets' shutdown state Pavel Emelyanov
2012-10-25 15:52 ` Stephen Hemminger
2012-10-25 16:53 ` Eric Dumazet
2012-10-25 17:09 ` Stephen Hemminger
2012-10-25 18:00 ` Eric Dumazet
2012-10-25 23:01 ` Stephen Hemminger
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=50893DAA.3010909@parallels.com \
--to=xemul@parallels$(echo .)com \
--cc=netdev@vger$(echo .)kernel.org \
--cc=shemminger@vyatta$(echo .)com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox