netfilter-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Pablo Neira Ayuso <pablo@netfilter.org>
To: Arturo Borrero Gonzalez <arturo@debian.org>
Cc: netfilter-devel@vger.kernel.org
Subject: Re: [nft PATCH v2] evaluate: avoid reference to multiple src data in statements which set values
Date: Mon, 29 May 2017 13:03:01 +0200	[thread overview]
Message-ID: <20170529110301.GA4822@salvia> (raw)
In-Reply-To: <149579635553.24003.5991119396424133127.stgit@nfdev2.cica.es>

On Fri, May 26, 2017 at 01:00:21PM +0200, Arturo Borrero Gonzalez wrote:
> Prevent this assert:
> 
> % nft [..] tcp dport set { 0 , 1 }
> BUG: unknown expression type set reference
> nft: netlink_linearize.c:696: netlink_gen_expr: Assertion `0' failed.
> Aborted
> 
> We can't use a set here because we will not known which value to use.
> 
> With this patch, a proper error message is reported to users:
> 
> % nft add rule t c tcp dport set {1, 2, 3, 4, 5}
> <cmdline>:1:28-42: Error: you cannot use a set here, unknown value to use
> add rule t c tcp dport set {1, 2, 3, 4, 5}
>              ~~~~~~~~~~~~~~^^^^^^^^^^^^^^^
> 
> % nft add rule t c tcp dport set @s
> <cmdline>:1:28-29: Error: you cannot reference a set here, unknown value to use
> add rule t c tcp dport set @s
>              ~~~~~~~~~~~~~~^^
> 
> This error is reported to all statements which set values.

Applied, thanks Arturo.

Probably you can add a test for this? It would be good to know what
error nft reports in case of BUG: message, so we can distinguish
between command error and assertion/bug.

      reply	other threads:[~2017-05-29 11:03 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-05-26 11:00 [nft PATCH v2] evaluate: avoid reference to multiple src data in statements which set values Arturo Borrero Gonzalez
2017-05-29 11:03 ` Pablo Neira Ayuso [this message]

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=20170529110301.GA4822@salvia \
    --to=pablo@netfilter.org \
    --cc=arturo@debian.org \
    --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).