From: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
To: Vadim Kochan <vadim4j@gmail.com>, netdev@vger.kernel.org
Subject: Re: [PATCH iproute2 REGRESSION] ss: Dont show netlink and packet sockets by default
Date: Sun, 14 Dec 2014 17:26:45 +0300 [thread overview]
Message-ID: <548D9E25.30100@cogentembedded.com> (raw)
In-Reply-To: <1418549765-9466-1-git-send-email-vadim4j@gmail.com>
Hello.
On 12/14/2014 12:36 PM, Vadim Kochan wrote:
> From: Vadim Kochan <vadim4j@gmail.com>
> Checking by SS_CLOSE state was remowed in:
> (45a4770bc0) ss: Remove checking SS_CLOSE state for packet and netlink
> which is not really correct because now by default all sockets are seen
> when do 'ss'.
> Here is most correct fix which considers specified family.
> To see netlink sockets:
> ss -A netlink
> To see packet sockets:
> ss -A packet
> And ss by default will show only connected/established sockets as it
> was before all the time.
>
> Signed-off-by: Vadim Kochan <vadim4j@gmail.com>
> ---
> misc/ss.c | 6 ++++++
> 1 file changed, 6 insertions(+)
> diff --git a/misc/ss.c b/misc/ss.c
> index e9927a5..6050ab6 100644
> --- a/misc/ss.c
> +++ b/misc/ss.c
> @@ -2801,6 +2801,9 @@ static int packet_show(struct filter *f)
> int ino;
> unsigned long long sk;
>
> + if (preferred_family != AF_PACKET && !(f->states & (1<<SS_CLOSE)))
Please surround << with spaces, to be consistent with other operators and
general kernel coding style.
> + return 0;
> +
> if (packet_show_netlink(f, NULL) == 0)
> return 0;
>
> @@ -3028,6 +3031,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)))
Likewise.
> + return 0;
> +
[...]
WBR, Sergei
next prev parent reply other threads:[~2014-12-14 14:26 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-12-14 9:36 [PATCH iproute2 REGRESSION] ss: Dont show netlink and packet sockets by default Vadim Kochan
2014-12-14 14:26 ` Sergei Shtylyov [this message]
2014-12-14 17:15 ` vadim4j
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=548D9E25.30100@cogentembedded.com \
--to=sergei.shtylyov@cogentembedded.com \
--cc=netdev@vger.kernel.org \
--cc=vadim4j@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).