]> git.ipfire.org Git - thirdparty/nftables.git/commit
parser: fix inconsistencies in set expression rules
authorPatrick McHardy <kaber@trash.net>
Sun, 12 Apr 2015 09:41:56 +0000 (10:41 +0100)
committerPatrick McHardy <kaber@trash.net>
Sun, 12 Apr 2015 18:59:27 +0000 (19:59 +0100)
commit6aa18b5216a34a2cd29ad4a1997c37f705f76247
treeb1b333844321906894687a6de0e06ea0811eaddb
parent48587aa855a5173b4b1e94290af885000dbd679e
parser: fix inconsistencies in set expression rules

Set keys are currently defined as a regular expr for pure sets and
map_lhs_expr for maps. map_lhs_expr is what can actually be used for
a single member, namely a concat_expr or a multiton_expr. The reason
why pure sets use expr for the key is to allow recursive set specifications,
which doesn't make sense for maps since every element needs a mapping.

However, the rule is too wide and also allows map expressions as a key,
which obviously doesn't make sense.

Rearrange the rules so we have:

set_lhs_expr: concat or multiton
set_rhs_expr: concat or verdict

and special case the recursive set specifications, as they deserve.

Besides making it a lot easier to understand what is actually supported,
this will be used by the following patch to support timeouts and comments
for keys in a uniform way.

Signed-off-by: Patrick McHardy <kaber@trash.net>
src/parser_bison.y