]> git.ipfire.org Git - thirdparty/nftables.git/commit
src: Make invalid chain priority error more specific
authorMáté Eckl <ecklm94@gmail.com>
Thu, 23 Aug 2018 10:51:07 +0000 (12:51 +0200)
committerPablo Neira Ayuso <pablo@netfilter.org>
Fri, 24 Aug 2018 08:09:30 +0000 (10:09 +0200)
commitcebbd9678b7ee6f74b3bd4eefc23de5b27135799
tree32020dae0f0326d12637e98b4af95ef029792cb5
parenta55ca1a24b7b216144dc737f621fb68f4a924e38
src: Make invalid chain priority error more specific

So far if invalid priority name was specified the error message referred
to the whole chain/flowtable specification:

nft> add chain ip x h { type filter hook prerouting priority first; }
Error: 'first' is invalid priority in this context.
add chain ip x h { type filter hook prerouting priority first; }
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

With this patch this reference is made specific to the priority
specification:

nft> add chain ip x h { type filter hook prerouting priority first; }
Error: 'first' is invalid priority in this context.
add chain ip x h { type filter hook prerouting priority first; }
                                               ^^^^^^^^^^^^^^

`prio_spec` is also reused to keep naming intuitive. The parser section
formerly named `prio_spec` is renamed to `int_num` as it basically
provides the mathematical set of integer numbers.

Signed-off-by: Máté Eckl <ecklm94@gmail.com>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
include/rule.h
src/evaluate.c
src/parser_bison.y