netfilter-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Balazs Scheidler <balazs.scheidler@balabit.com>
To: netfilter-devel@vger.kernel.org
Subject: nftables: parser conflict between tokens & symbols
Date: Fri, 26 Jun 2015 14:44:23 +0200	[thread overview]
Message-ID: <20150626124423.GB5835@bzorp> (raw)

Hi,

I've noticed that our set of keywords in nftables is pretty rich and
this can cause conflicts in the grammar when a keyword is also used
as a symbol.

For instance, we do have a "redirect" expression and "redirect" as
a word is also used as an ICMP message type.

# here is the redirect expression in action, which works:
$ nft add rule tcp dport 80 redirect to 8080

# here's an ICMP rule that works
$ nft add rule filter input icmp type echo-request accept

# here's an ICMP rule that should work, but it doesn't
$ nft add rule filter input icmp type redirect accept

The root cause is that "redirect" is now recognized as a token, whereas the
icmp type is expecting a STRING token.

I have tried to solve this but the idea I had didn't work out, and I don't
really have more time now to fix it, but still thought this information
would be useful.

Cheers,
Bazsi

             reply	other threads:[~2015-06-27 12:27 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-06-26 12:44 Balazs Scheidler [this message]
2015-06-29 14:57 ` nftables: parser conflict between tokens & symbols Florian Westphal
2015-06-29 18:09   ` Pablo Neira Ayuso
2015-06-29 18:15     ` Patrick McHardy
2015-06-29 18:03 ` Pablo Neira Ayuso

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20150626124423.GB5835@bzorp \
    --to=balazs.scheidler@balabit.com \
    --cc=netfilter-devel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).