diff options
author | Florian Westphal <fw@strlen.de> | 2020-02-20 12:58:40 +0100 |
---|---|---|
committer | Florian Westphal <fw@strlen.de> | 2020-02-22 09:54:25 +0100 |
commit | dbfcb1fa29da670ae565caef48760b9ac1c21a0b (patch) | |
tree | 3a77bdc993de5d0506e6f8b02beb95478ea9ae28 /src | |
parent | 78bbe7f7a55be48909067e25900de27623d8fa6a (diff) |
evaluate: print correct statement name on family mismatch
nft add rule inet filter c ip daddr 1.2.3.4 dnat ip6 to f00::1
Error: conflicting protocols specified: ip vs. unknown. You must specify ip or ip6 family in tproxy statement
Should be: ... "in nat statement".
Fixes: fbe27464dee4588d90 ("src: add nat support for the inet family")
Signed-off-by: Florian Westphal <fw@strlen.de>
Diffstat (limited to 'src')
-rw-r--r-- | src/evaluate.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/evaluate.c b/src/evaluate.c index a3cbf939..ae629abe 100644 --- a/src/evaluate.c +++ b/src/evaluate.c @@ -2807,9 +2807,10 @@ static int stmt_evaluate_l3proto(struct eval_ctx *ctx, (nproto == &proto_ip6 && family != NFPROTO_IPV6)) return stmt_binary_error(ctx, stmt, &ctx->pctx.protocol[PROTO_BASE_NETWORK_HDR], - "conflicting protocols specified: %s vs. %s. You must specify ip or ip6 family in tproxy statement", + "conflicting protocols specified: %s vs. %s. You must specify ip or ip6 family in %s statement", ctx->pctx.protocol[PROTO_BASE_NETWORK_HDR].desc->name, - family2str(stmt->tproxy.family)); + family2str(family), + stmt->ops->name); return 0; } |