Thread (12 messages) 12 messages, 3 authors, 2012-10-27

[PATCH 4/5] ss: Get udp sockets info via sock-diag

flat view
STALE5110d

From: Pavel Emelyanov <hidden>
Date: 2012-10-25 13:24:59
Subsystem: the rest · Maintainer: Linus Torvalds

Now everything is prepared for it, so the patch is straightforward.

Signed-off-by: Pavel Emelyanov <redacted>

---
 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
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help