Re: [PATCHv2 iproute2 net-next] tc: m_mirred: Fix parsing of 'index' optional argument

2016-11-29 Thread Stephen Hemminger
On Thu, 27 Oct 2016 22:00:40 +0300 Shmulik Ladkani wrote: > Hi, > > On Thu, 27 Oct 2016 16:56:43 +0200 Phil Sutter wrote: > > > Actual code, since first committed, attempts to parse "index" as 1st > > > argument (without success), see parse_mirred(): > >

Re: [PATCHv2 iproute2 net-next] tc: m_mirred: Fix parsing of 'index' optional argument

2016-10-27 Thread Shmulik Ladkani
Hi, On Thu, 27 Oct 2016 16:56:43 +0200 Phil Sutter wrote: > > Actual code, since first committed, attempts to parse "index" as 1st > > argument (without success), see parse_mirred(): > > > > if (matches(*argv, "egress") == 0 || matches(*argv, "index") == 0) { > >

Re: [PATCHv2 iproute2 net-next] tc: m_mirred: Fix parsing of 'index' optional argument

2016-10-27 Thread Phil Sutter
On Thu, Oct 27, 2016 at 05:22:39PM +0300, Shmulik Ladkani wrote: > Hi Phil, > > On Thu, 27 Oct 2016 11:46:33 +0200, p...@nwl.cc wrote: > > According to the action's help text (and the man page which is based > > upon that), this behaviour is perfectly fine: > > > > | Usage: mirred [index

Re: [PATCHv2 iproute2 net-next] tc: m_mirred: Fix parsing of 'index' optional argument

2016-10-27 Thread Phil Sutter
Hi, On Thu, Oct 27, 2016 at 10:36:06AM +0300, Shmulik Ladkani wrote: > Code in parse_mirred() suggests "index" argument can be placed either > after the egress/ingress clause, or as the first argument (after > "action mirred"). > > However, parse_direction() fails to correctly parse "index" if

Re: [PATCHv2 iproute2 net-next] tc: m_mirred: Fix parsing of 'index' optional argument

2016-10-27 Thread Shmulik Ladkani
Hi Phil, On Thu, 27 Oct 2016 11:46:33 +0200, p...@nwl.cc wrote: > According to the action's help text (and the man page which is based > upon that), this behaviour is perfectly fine: > > | Usage: mirred [index INDEX] > > So first argument *must* be the direction, second one *must* be the >

[PATCHv2 iproute2 net-next] tc: m_mirred: Fix parsing of 'index' optional argument

2016-10-27 Thread Shmulik Ladkani
Code in parse_mirred() suggests "index" argument can be placed either after the egress/ingress clause, or as the first argument (after "action mirred"). However, parse_direction() fails to correctly parse "index" if it's the first argument. For example: # tc filter add ... action mirred index