diff options
author | Pablo Neira Ayuso <pablo@netfilter.org> | 2020-03-31 19:25:57 +0200 |
---|---|---|
committer | Pablo Neira Ayuso <pablo@netfilter.org> | 2020-03-31 19:27:46 +0200 |
commit | 6428601937f8389eac17496f00f81276cad285f3 (patch) | |
tree | 942f0cb28e7815e1ce9dd1a696625ed02d9359a0 /src/evaluate.c | |
parent | 41d48cb6de2c68f05a9122353b1608f34ed33957 (diff) |
evaluate: check for device in non-netdev chains
# nft -f /tmp/x
/tmp/x:3:26-36: Error: This chain type cannot be bound to device
type filter hook input device eth0 priority 0
^^^^^^^^^^^
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'src/evaluate.c')
-rw-r--r-- | src/evaluate.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/evaluate.c b/src/evaluate.c index 84fe89ee..fcc79386 100644 --- a/src/evaluate.c +++ b/src/evaluate.c @@ -3805,6 +3805,9 @@ static int chain_evaluate(struct eval_ctx *ctx, struct chain *chain) if (!chain->dev_expr) return __stmt_binary_error(ctx, &chain->loc, NULL, "Missing `device' in this chain definition"); + } else if (chain->dev_expr) { + return __stmt_binary_error(ctx, &chain->dev_expr->location, NULL, + "This chain type cannot be bound to device"); } } |