netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Vadim Kochan <vadim4j@gmail.com>
To: Stephen Hemminger <stephen@networkplumber.org>
Cc: Vadim Kochan <vadim4j@gmail.com>, netdev@vger.kernel.org
Subject: Re: [PATCH iproute2] ss: Filter inet dgram sockets with established state by default
Date: Thu, 15 Jan 2015 00:43:47 +0200	[thread overview]
Message-ID: <20150114224347.GA14983@angus-think.lan> (raw)
In-Reply-To: <20150114144120.0e15ac1f@urahara>

On Wed, Jan 14, 2015 at 02:41:20PM -0800, Stephen Hemminger wrote:
> On Wed, 14 Jan 2015 08:49:44 +0200
> Vadim Kochan <vadim4j@gmail.com> wrote:
> 
> > On Tue, Jan 13, 2015 at 05:31:50PM -0800, Stephen Hemminger wrote:
> > > On Thu,  8 Jan 2015 19:32:22 +0200
> > > Vadim Kochan <vadim4j@gmail.com> wrote:
> > > 
> > > > From: Vadim Kochan <vadim4j@gmail.com>
> > > > 
> > > > As inet dgram sockets (udp, raw) can call connect(...)  - they
> > > > might be set in ESTABLISHED state. So keep the original behaviour of
> > > > 'ss' which filtered them by ESTABLISHED state by default. So:
> > > > 
> > > >     $ ss -u
> > > > 
> > > >     or
> > > > 
> > > >     $ ss -w
> > > > 
> > > > Will show only ESTABLISHED UDP sockets by default.
> > > > 
> > > > Signed-off-by: Vadim Kochan <vadim4j@gmail.com>
> > > > ---
> > > >  misc/ss.c | 4 ++--
> > > >  1 file changed, 2 insertions(+), 2 deletions(-)
> > > > 
> > > > diff --git a/misc/ss.c b/misc/ss.c
> > > > index 08d210a..015d829 100644
> > > > --- a/misc/ss.c
> > > > +++ b/misc/ss.c
> > > > @@ -170,11 +170,11 @@ static const struct filter default_dbs[MAX_DB] = {
> > > >  		.families = (1 << AF_INET) | (1 << AF_INET6),
> > > >  	},
> > > >  	[UDP_DB] = {
> > > > -		.states   = (1 << SS_CLOSE),
> > > > +		.states   = (1 << SS_ESTABLISHED),
> > > >  		.families = (1 << AF_INET) | (1 << AF_INET6),
> > > >  	},
> > > >  	[RAW_DB] = {
> > > > -		.states   = (1 << SS_CLOSE),
> > > > +		.states   = (1 << SS_ESTABLISHED),
> > > >  		.families = (1 << AF_INET) | (1 << AF_INET6),
> > > >  	},
> > > >  	[UNIX_DG_DB] = {
> > > 
> > > This is a change likely to break somebody using 'ss -u' now and the bound
> > > sockets will disappear from the output.
> > > 
> > 
> > But thats was as original behaviour before I added table-driven code
> > (about few commits ago), so thats a rather fix (sorry I did not noticed
> > about it) to keep the previous behaviour for dgram sockets - show
> > established states by default.
> > 
> > Regards,
> 
> Ok, I will merge it and update the comments.
Even with this PATCH I am still confused what is preferred behaviour -
show established dgram sockets (as it was all the way) or closed + established by default.

What do you think ?

Thanks,

  reply	other threads:[~2015-01-14 22:54 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-01-08 17:32 [PATCH iproute2] ss: Filter inet dgram sockets with established state by default Vadim Kochan
2015-01-14  1:31 ` Stephen Hemminger
2015-01-14  6:49   ` Vadim Kochan
2015-01-14 22:41     ` Stephen Hemminger
2015-01-14 22:43       ` Vadim Kochan [this message]
2015-01-15  2:48         ` Stephen Hemminger
2015-01-15  4:49           ` Vadim Kochan

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=20150114224347.GA14983@angus-think.lan \
    --to=vadim4j@gmail.com \
    --cc=netdev@vger.kernel.org \
    --cc=stephen@networkplumber.org \
    /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).