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 <pablo@netfilter.org>
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);
break;
}