Subject: Re: [PATCH iproute2 3/3] ss: Filtering logic changing, with fixes

From: Vadim Kochan <[email-masked]>
Date: Sun, 4 Jan 2015 00:58:11 +0200

On Sat, Jan 03, 2015 at 09:57:07AM -0800, Stephen Hemminger wrote:
> On Sat,  3 Jan 2015 02:44:37 +0200
> Vadim Kochan <[email-masked]> wrote:
> 
> > +struct filter default_dbs[MAX_DB] = {
> > +	[TCP_DB] = {
> > +		.states   = SS_CONN,
> > +		.families = (1 << AF_INET) | (1 << AF_INET6),
> > +	},
> 
> I like table driven code, so this is good. But please make
> mark the table as const.

I did re-test, and I still don't like very much my results (some cases
are not logically) even if they (IMHO) better than the 'master' version,
so I will try to change filer options applying in the following way:

    0) default filter should have only default states & all dbs

    1) apply all selected families with their default dbs & states from table

    2) logical AND selected dbs with dbs of the selected families and their default
        states from table, also select families by db from table if there no
        already selected families

    3) logical AND selected states with selected dbs and their default states from table,
        also select families and dbs from table by states if there no
        already selected dbs & families

So with such approach the options should affect each other in the strict
predictable way:

    families -> dbs (socket tables) -> socket states

I hope I will success with this ...

I appreciate any feedback.

Regards,
Vadim Kochan