All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andreas Schultz <aschultz@tpip.net>
To: Pablo Neira Ayuso <pablo@netfilter.org>
Cc: netfilter-devel@vger.kernel.org
Subject: Re: nft: parser problem, can use mark as datatype in sets and maps
Date: Tue, 11 Aug 2015 11:18:54 +0200	[thread overview]
Message-ID: <55C9BDFE.9080207@tpip.net> (raw)
In-Reply-To: <20150810170920.GA3487@salvia>

On 08/10/2015 07:09 PM, Pablo Neira Ayuso wrote:
> On Mon, Aug 10, 2015 at 03:48:12PM +0200, Andreas Schultz wrote:
>> Hi,
>>
>> The data type definition for mark and the general idea of the parser
>> indicate that the following nft statements should work:
>>
>>    # nft add map filter MAP1 { type ipv4_addr : mark\; }
>>    # nft add set filter SET1 { type mark\; }
>>
>> However, both fail with a similar error message:
>>
>>    <cmdline>:1:40-43: Error: syntax error, unexpected mark, expecting string
>>    add map filter MAP1 { type ipv4_addr : mark; }
>>    <cmdline>:1:28-31: Error: syntax error, unexpected mark, expecting string
>>    add set filter SET1 { type mark; }
>>
>> The problem is parser, it expects a string as data type spec, but
>> mark is already declared as a token.
>>
>> I don't have much experience with bison, so does anyone have a quick
>> work-around for this?
>
> This is fixed by 2baf59c ("parser_bison: allow to use mark as datatype
> for maps and sets").

Ah, I was using the next-4.2 branch and missed this fix in master, sorry 
for the noise.

However, the parser problem is solved, but named mark maps are still
not working:

anonymous maps work as expected:

   # nft add rule ip mangle OUTPUT mark set ip saddr map {  192.168.0.10 
: 0x1 }

named maps do not:

   # nft add map mangle CLASS05 "{ type ipv4_addr : mark; }"
   # nft add element mangle CLASS05 { 192.168.0.10 : 0x1 }
   # nft add rule ip mangle OUTPUT mark set ip saddr map @CLASS05
   <cmdline>:1:1-56: Error: Could not process rule: Invalid argument

Any idea?

Andreas

  reply	other threads:[~2015-08-11  9:18 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-08-10 13:48 nft: parser problem, can use mark as datatype in sets and maps Andreas Schultz
2015-08-10 17:09 ` Pablo Neira Ayuso
2015-08-11  9:18   ` Andreas Schultz [this message]
2015-08-11 10:41     ` Pablo Neira Ayuso
2015-08-11 11:25       ` Andreas Schultz
2015-08-11 12:12         ` Pablo Neira Ayuso
2015-08-11 12:23           ` Pablo Neira Ayuso
2015-08-11 12:28             ` Andreas Schultz

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=55C9BDFE.9080207@tpip.net \
    --to=aschultz@tpip.net \
    --cc=netfilter-devel@vger.kernel.org \
    --cc=pablo@netfilter.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.