From mboxrd@z Thu Jan 1 00:00:00 1970 From: Vadim Kochan Subject: Re: [PATCH iproute2] ss: Filter inet dgram sockets with established state by default Date: Thu, 15 Jan 2015 00:43:47 +0200 Message-ID: <20150114224347.GA14983@angus-think.lan> References: <1420738342-3750-1-git-send-email-vadim4j@gmail.com> <20150113173150.0a50f74e@urahara> <20150114064944.GA28611@angus-think.lan> <20150114144120.0e15ac1f@urahara> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Vadim Kochan , netdev@vger.kernel.org To: Stephen Hemminger Return-path: Received: from mail-la0-f47.google.com ([209.85.215.47]:56581 "EHLO mail-la0-f47.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751590AbbANWyT (ORCPT ); Wed, 14 Jan 2015 17:54:19 -0500 Received: by mail-la0-f47.google.com with SMTP id hz20so10781731lab.6 for ; Wed, 14 Jan 2015 14:54:17 -0800 (PST) Content-Disposition: inline In-Reply-To: <20150114144120.0e15ac1f@urahara> Sender: netdev-owner@vger.kernel.org List-ID: On Wed, Jan 14, 2015 at 02:41:20PM -0800, Stephen Hemminger wrote: > On Wed, 14 Jan 2015 08:49:44 +0200 > Vadim Kochan 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 wrote: > > > > > > > From: Vadim Kochan > > > > > > > > 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 > > > > --- > > > > 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,