diff options
author | Pablo Neira Ayuso <pablo@netfilter.org> | 2014-09-16 11:03:57 +0200 |
---|---|---|
committer | Pablo Neira Ayuso <pablo@netfilter.org> | 2014-09-17 10:17:38 +0200 |
commit | 55ee009aaa650553868509081f2e2c5e2915008c (patch) | |
tree | d9217f803b7b801f063b0f1204f7eab55bbbee9f /include | |
parent | 102c30013e622a9ffdccace52dee2552b06e5d3d (diff) |
src: fix 'describe' command when passing wrong expressions
Before this patch:
# nft describe tcp foo
value expression, datatype inet_proto (Internet protocol) (basetype integer), 8 bits
Segmentation fault
After this patch:
# nft describe tcp foo
<cmdline>:1:14-16: Error: syntax error, unexpected string, expecting end of file or newline or semicolon
describe tcp foo
^^^
Reported-by: Kevin Fenzi <kevin@scrye.com>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'include')
-rw-r--r-- | include/rule.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/include/rule.h b/include/rule.h index db914068..88aefc69 100644 --- a/include/rule.h +++ b/include/rule.h @@ -218,6 +218,7 @@ extern void set_print_plain(const struct set *s); * @CMD_RENAME: rename object * @CMD_EXPORT: export the ruleset in a given format * @CMD_MONITOR: event listener + * @CMD_DESCRIBE: describe an expression */ enum cmd_ops { CMD_INVALID, @@ -230,6 +231,7 @@ enum cmd_ops { CMD_RENAME, CMD_EXPORT, CMD_MONITOR, + CMD_DESCRIBE, }; /** @@ -243,6 +245,7 @@ enum cmd_ops { * @CMD_OBJ_CHAIN: chain * @CMD_OBJ_TABLE: table * @CMD_OBJ_RULESET: ruleset + * @CMD_OBJ_EXPR: expression */ enum cmd_obj { CMD_OBJ_INVALID, @@ -253,6 +256,7 @@ enum cmd_obj { CMD_OBJ_CHAIN, CMD_OBJ_TABLE, CMD_OBJ_RULESET, + CMD_OBJ_EXPR, }; /** |