* [PATCH nft] mnl: restore --debug=netlink output with chains
@ 2024-11-07 8:02 Pablo Neira Ayuso
0 siblings, 0 replies; only message in thread
From: Pablo Neira Ayuso @ 2024-11-07 8:02 UTC (permalink / raw)
To: netfilter-devel
table and chain name are not displayed with --debug=netlink:
# nft --debug=netlink -f /tmp/x
inet (null) (null) use 0
...
Similar to 79acbfdbe536 ("mnl: restore --debug=netlink output with sets").
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
---
src/mnl.c | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/src/mnl.c b/src/mnl.c
index 12a6345cbed8..45d63c94afdf 100644
--- a/src/mnl.c
+++ b/src/mnl.c
@@ -835,8 +835,16 @@ int mnl_nft_chain_add(struct netlink_ctx *ctx, struct cmd *cmd,
nftnl_udata_buf_free(udbuf);
}
}
+
+
+ nftnl_chain_set_str(nlc, NFTNL_CHAIN_TABLE, cmd->handle.table.name);
+ nftnl_chain_set_str(nlc, NFTNL_CHAIN_NAME, cmd->handle.chain.name);
+
netlink_dump_chain(nlc, ctx);
+ nftnl_chain_unset(nlc, NFTNL_CHAIN_TABLE);
+ nftnl_chain_unset(nlc, NFTNL_CHAIN_NAME);
+
nlh = nftnl_nlmsg_build_hdr(nftnl_batch_buffer(ctx->batch),
NFT_MSG_NEWCHAIN,
cmd->handle.family,
--
2.30.2
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2024-11-07 8:02 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-11-07 8:02 [PATCH nft] mnl: restore --debug=netlink output with chains Pablo Neira Ayuso
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox