Re: [PATCH 2/2 nft] scanner: fix parsing of tc handle

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Feb 13, 2014 at 01:01:03PM +0000, Patrick McHardy wrote:
> On Thu, Feb 13, 2014 at 11:51:12AM +0000, Patrick McHardy wrote:
> > On Thu, Feb 13, 2014 at 12:41:12PM +0100, Pablo Neira Ayuso wrote:
> > > hexstring:hexstring
> > > hexstring:
> > > :hexstring
> > > ---
> > > The spaces to separate the key and the action in dictionaries is very
> > > important, otherwise (with this patch) the scanner misinterprets this.
> > > 
> > >  # nft add filter input tcp dport vmap { 25:drop }
> > >  <cmdline>:1:41-43: Error: syntax error, unexpected string, expecting comma or '}'
> > >  add rule filter input tcp dport vmap { 25:drop }
> > >                                         ^^^
> > > I think we can just document this, I don't see any better solution for this
> > > at this moment.
> > 
> > Let me try if I can come up with something ...
> 
> I think we might be able to do something with flex "trailing contexts",
> though I didn't manage to figure it out yet.
> 
> Generally it seems like using a ':' in maps might not be the best idea
> after all, its used for too many other things already. This might be
> the reason why I initially used =>, not sure anymore.
> 
> Is there a reasonable alternative to ':' with a single character?

Everything seems pretty overloaded, and I still like that python uses
this for dictionaries.

I think even bash and gcc provide bad error reporting if one space is
missing in a for/while statement or a missing bracket is left out.

Let's check if that trailing context can help us to fix it, if not,
just document it.

We can revisit the scanner/parser at some point. I checked antlr but I
don't think their C library API is very stable / ready for third party
project. But not now, we already have quite a lot of work in many
other fronts :)
--
To unsubscribe from this list: send the line "unsubscribe netfilter-devel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Netfitler Users]     [LARTC]     [Bugtraq]     [Yosemite Forum]

  Powered by Linux