From: Vadim Kochan Date: Sun, 22 Feb 2015 20:23:10 +0000 (+0200) Subject: ss: Add filter before printing unix stats from Netlink X-Git-Tag: v4.0.0~36 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=29999b0ff23d76e5d93d238a0461c59841afea73;p=thirdparty%2Fiproute2.git ss: Add filter before printing unix stats from Netlink Detailed info can be printed if filter should not pass the socket info. Signed-off-by: Vadim Kochan --- diff --git a/misc/ss.c b/misc/ss.c index 2678033fc..5320d3870 100644 --- a/misc/ss.c +++ b/misc/ss.c @@ -2556,7 +2556,7 @@ static void unix_stats_print(struct sockstat *list, struct filter *f) } } - if (f->f) { + if (use_proc && f->f) { if (strcmp(peer, "*") == 0) memset(s->remote.data, 0, sizeof(char *)); else @@ -2628,6 +2628,9 @@ static int unix_show_sock(const struct sockaddr_nl *addr, struct nlmsghdr *nlh, if (tb[UNIX_DIAG_PEER]) stat.rport = rta_getattr_u32(tb[UNIX_DIAG_PEER]); + if (f->f && run_ssfilter(f->f, &stat) == 0) + return 0; + unix_stats_print(&stat, f); if (show_mem) {