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 <vadim4j@gmail.com>
This commit is contained in:
parent
6b8c871dc1
commit
29999b0ff2
|
|
@ -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)
|
if (strcmp(peer, "*") == 0)
|
||||||
memset(s->remote.data, 0, sizeof(char *));
|
memset(s->remote.data, 0, sizeof(char *));
|
||||||
else
|
else
|
||||||
|
|
@ -2628,6 +2628,9 @@ static int unix_show_sock(const struct sockaddr_nl *addr, struct nlmsghdr *nlh,
|
||||||
if (tb[UNIX_DIAG_PEER])
|
if (tb[UNIX_DIAG_PEER])
|
||||||
stat.rport = rta_getattr_u32(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);
|
unix_stats_print(&stat, f);
|
||||||
|
|
||||||
if (show_mem) {
|
if (show_mem) {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue