diff --git a/misc/ss.c b/misc/ss.c index 15fa2bc5..fa73fac3 100644 --- a/misc/ss.c +++ b/misc/ss.c @@ -2743,6 +2743,9 @@ static int packet_show(struct filter *f) int uid; int ino; unsigned long long sk; + + if (preferred_family != AF_PACKET && !(f->states & (1 << SS_CLOSE))) + return 0; if (packet_show_netlink(f) == 0) return 0; @@ -2972,6 +2975,9 @@ static int netlink_show(struct filter *f) int rq, wq, rc; unsigned long long sk, cb; + if (preferred_family != AF_NETLINK && !(f->states & (1 << SS_CLOSE))) + return 0; + if (!getenv("PROC_NET_NETLINK") && !getenv("PROC_ROOT") && netlink_show_netlink(f) == 0) return 0;