Commit 29999b0f authored by Vadim Kochan's avatar Vadim Kochan Committed by Stephen Hemminger

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: default avatarVadim Kochan <vadim4j@gmail.com>
parent 6b8c871d
......@@ -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) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment