[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1424636591-19903-3-git-send-email-vadim4j@gmail.com>
Date: Sun, 22 Feb 2015 22:23:11 +0200
From: Vadim Kochan <vadim4j@...il.com>
To: netdev@...r.kernel.org
Cc: Vadim Kochan <vadim4j@...il.com>
Subject: [PATCH iproute2 2/2] ss: Skip filtered netlink sockets before detailed info
From: Vadim Kochan <vadim4j@...il.com>
Signed-off-by: Vadim Kochan <vadim4j@...il.com>
---
misc/ss.c | 12 +++++++-----
1 file changed, 7 insertions(+), 5 deletions(-)
diff --git a/misc/ss.c b/misc/ss.c
index 5320d38..5113d85 100644
--- a/misc/ss.c
+++ b/misc/ss.c
@@ -2938,7 +2938,7 @@ static int packet_show(struct filter *f)
return 0;
}
-static void netlink_show_one(struct filter *f,
+static int netlink_show_one(struct filter *f,
int prot, int pid, unsigned groups,
int state, int dst_pid, unsigned dst_group,
int rq, int wq,
@@ -2960,7 +2960,7 @@ static void netlink_show_one(struct filter *f,
st.lport = pid;
st.local.data[0] = prot;
if (run_ssfilter(f->f, &st) == 0)
- return;
+ return 1;
}
sock_state_print(&st, "nl");
@@ -3032,7 +3032,7 @@ static void netlink_show_one(struct filter *f,
}
printf("\n");
- return;
+ return 0;
}
static int netlink_show_sock(const struct sockaddr_nl *addr,
@@ -3058,9 +3058,11 @@ static int netlink_show_sock(const struct sockaddr_nl *addr,
wq = skmeminfo[SK_MEMINFO_WMEM_ALLOC];
}
- netlink_show_one(f, r->ndiag_protocol, r->ndiag_portid, groups,
+ if (netlink_show_one(f, r->ndiag_protocol, r->ndiag_portid, groups,
r->ndiag_state, r->ndiag_dst_portid, r->ndiag_dst_group,
- rq, wq, 0, 0);
+ rq, wq, 0, 0)) {
+ return 0;
+ }
if (show_mem) {
printf("\t");
--
2.2.2
--
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