path: root/src
diff options
authorPablo Neira Ayuso <>2017-06-19 13:59:33 +0200
committerPablo Neira Ayuso <>2017-06-19 19:04:49 +0200
commitd129f83435adf65d30de28d50de0792b731f87a6 (patch)
tree309a788e789b9d98fa1e92316fedfaae9fdf440d /src
parentbada2f9c182dddf72a6d3b7b00c9eace7eb596c3 (diff)
evaluate: Better error reporting for bad set references
In case you refer to an unexisting set, bail out with: # nft add table x # nft add chain x y # nft add rule x y ip protocol vmap @reject_to_rule2; <cmdline>:1:31-46: Error: Set 'reject_to_rule2' does not exist add rule x y ip protocol vmap @reject_to_rule2 ^^^^^^^^^^^^^^^^ Signed-off-by: Pablo Neira Ayuso <>
Diffstat (limited to 'src')
1 files changed, 3 insertions, 2 deletions
diff --git a/src/evaluate.c b/src/evaluate.c
index ec898033..ca8b63b7 100644
--- a/src/evaluate.c
+++ b/src/evaluate.c
@@ -192,8 +192,9 @@ static int expr_evaluate_symbol(struct eval_ctx *ctx, struct expr **expr)
set = set_lookup(table, (*expr)->identifier);
if (set == NULL)
- return cmd_error(ctx, "Could not process rule: Set '%s' does not exist",
- (*expr)->identifier);
+ return expr_error(ctx->msgs, *expr,
+ "Set '%s' does not exist",
+ (*expr)->identifier);
new = set_ref_expr_alloc(&(*expr)->location, set);