ss: enable query by type in unix domain related socket

This patch enables -A unix_stream, -A unix_dgram and
-A unix_seqpacket option even if ss gets socket information
via netlink.

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
This commit is contained in:
Masatake YAMATO 2014-01-08 20:13:47 +09:00 committed by Stephen Hemminger
parent 30b669d7ac
commit 0d2e01c5ee

View File

@ -2205,6 +2205,13 @@ static int unix_show_sock(struct nlmsghdr *nlh, struct filter *f)
parse_rtattr(tb, UNIX_DIAG_MAX, (struct rtattr*)(r+1), parse_rtattr(tb, UNIX_DIAG_MAX, (struct rtattr*)(r+1),
nlh->nlmsg_len - NLMSG_LENGTH(sizeof(*r))); nlh->nlmsg_len - NLMSG_LENGTH(sizeof(*r)));
if (r->udiag_type == SOCK_STREAM && !(f->dbs&(1<<UNIX_ST_DB)))
return 0;
if (r->udiag_type == SOCK_DGRAM && !(f->dbs&(1<<UNIX_DG_DB)))
return 0;
if (r->udiag_type == SOCK_SEQPACKET && !(f->dbs&(1<<UNIX_SQ_DB)))
return 0;
if (netid_width) if (netid_width)
printf("%-*s ", netid_width, printf("%-*s ", netid_width,
unix_netid_name(r->udiag_type)); unix_netid_name(r->udiag_type));