summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPablo Neira Ayuso <pablo@netfilter.org>2024-11-07 09:00:55 +0100
committerPablo Neira Ayuso <pablo@netfilter.org>2024-11-11 11:40:08 +0100
commit9de8ec88cde86c5576ecf862f06be945f4042071 (patch)
tree3a964c590cb6efe1269bf3031edd075d71394522
parent058246016188c8418cae1b3db70b16b935b1fe7c (diff)
mnl: restore --debug=netlink output with chainsHEADmaster
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>
-rw-r--r--src/mnl.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/mnl.c b/src/mnl.c
index 12a6345c..828006c4 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);
+ if (cmd->handle.chain.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,