diff options
author | Pablo Neira Ayuso <pablo@netfilter.org> | 2021-05-19 22:27:42 +0200 |
---|---|---|
committer | Pablo Neira Ayuso <pablo@netfilter.org> | 2021-05-20 00:13:35 +0200 |
commit | ad2f90d0958bebc2565db7415e8c1d2ceee1e0d6 (patch) | |
tree | 2592b64819a9a8a2955d14db06834c7620146aa8 | |
parent | 5008798157e2114f9fc47bff46e4e6f03c9c7a14 (diff) |
cmd: typo in chain fuzzy lookup
Refer to chain, not table.
Error: No such file or directory; did you mean table ‘z’ in family ip?
add chain x y { type filter nat prerouting priority dstnat; }
^
It should say instead:
Error: No such file or directory; did you mean chain ‘z’ in table ip ‘x’?
[ Florian added args check for fmt to the netlink_io_error() prototype. ]
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
-rw-r--r-- | include/netlink.h | 2 | ||||
-rw-r--r-- | src/cmd.c | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/include/netlink.h b/include/netlink.h index a7c524ca..0c8655ca 100644 --- a/include/netlink.h +++ b/include/netlink.h @@ -181,7 +181,7 @@ extern void netlink_dump_flowtable(struct nftnl_flowtable *flo, struct netlink_c __netlink_abi_error(__FILE__, __LINE__, strerror(errno)); extern void __noreturn __netlink_abi_error(const char *file, int line, const char *reason); extern int netlink_io_error(struct netlink_ctx *ctx, - const struct location *loc, const char *fmt, ...); + const struct location *loc, const char *fmt, ...) __attribute__((format(printf, 3, 4))); #define netlink_init_error() \ __netlink_init_error(__FILE__, __LINE__, strerror(errno)); extern void __noreturn __netlink_init_error(const char *file, int line, const char *reason); @@ -40,7 +40,7 @@ static int nft_cmd_enoent_chain(struct netlink_ctx *ctx, const struct cmd *cmd, if (!chain) return 0; - netlink_io_error(ctx, loc, "%s; did you mean table ‘%s’ in family %s?", + netlink_io_error(ctx, loc, "%s; did you mean chain ‘%s’ in table %s ‘%s’?", strerror(ENOENT), chain->handle.chain.name, family2str(table->handle.family), table->handle.table.name); |