]> git.ipfire.org Git - thirdparty/nftables.git/commitdiff
evaluate: print correct statement name on family mismatch
authorFlorian Westphal <fw@strlen.de>
Thu, 20 Feb 2020 11:58:40 +0000 (12:58 +0100)
committerFlorian Westphal <fw@strlen.de>
Sat, 22 Feb 2020 08:54:25 +0000 (09:54 +0100)
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>
src/evaluate.c

index a3cbf9398b66b675b2d6ba21f4a7fede10b13fb7..ae629abe247a78b496b83d5d73ce005336f6220e 100644 (file)
@@ -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;
 }