Re: [PATCH net-next V4] tc: flower: Refactor matching flags to be more user friendly

2017-01-20 Thread Jiri Benc
On Fri, 20 Jan 2017 12:27:42 +, David Laight wrote: > Consider what happened with "no", "nofubar" and "nofubar_baz", > all ought to be rejected. Why? "no" translates to "", "nofubar" to "fubar", etc. And those will be evaluated the same way as if they were supplied without the "no". I don't

RE: [PATCH net-next V4] tc: flower: Refactor matching flags to be more user friendly

2017-01-20 Thread David Laight
From: Of Jiri Benc > Sent: 19 January 2017 14:22 > On Thu, 19 Jan 2017 16:17:48 +0200, Paul Blakey wrote: > > + while (token) { > > + if (!strncmp(token, "no", 2)) { > > + no = true; > > + token = strchr(token, '_') + 1; > > This seems to still

Re: [PATCH net-next V4] tc: flower: Refactor matching flags to be more user friendly

2017-01-19 Thread Paul Blakey
On 19/01/2017 16:22, Jiri Benc wrote: On Thu, 19 Jan 2017 16:17:48 +0200, Paul Blakey wrote: + while (token) { + if (!strncmp(token, "no", 2)) { + no = true; + token = strchr(token, '_') + 1; This seems to still assume that

[PATCH net-next V4] tc: flower: Refactor matching flags to be more user friendly

2017-01-19 Thread Paul Blakey
Instead of "magic numbers" we can now specify each flag by name. Prefix of "no" (e.g nofrag) unsets the flag, otherwise it wil be set. Example: # add a flower filter that will drop fragmented packets tc filter add dev ens4f0 protocol ip parent : \ flower \

Re: [PATCH net-next V4] tc: flower: Refactor matching flags to be more user friendly

2017-01-19 Thread Jiri Benc
On Thu, 19 Jan 2017 16:17:48 +0200, Paul Blakey wrote: > + while (token) { > + if (!strncmp(token, "no", 2)) { > + no = true; > + token = strchr(token, '_') + 1; This seems to still assume that "no" is followed by an underscore. What about a