All of lore.kernel.org
 help / color / mirror / Atom feed
* [nft PATCH] netlink: Use nftnl_expr_fprintf() in netlink_dump_expr()
@ 2017-10-04 21:41 Phil Sutter
  2017-10-17 13:20 ` Pablo Neira Ayuso
  0 siblings, 1 reply; 2+ messages in thread
From: Phil Sutter @ 2017-10-04 21:41 UTC (permalink / raw)
  To: Pablo Neira Ayuso; +Cc: netfilter-devel

This gets rid of the temporary buffer.

Signed-off-by: Phil Sutter <phil@nwl.cc>
---
Please note that this patch depends on the previously submitted libnftnl
patch "expr: Introduce nftnl_expr_fprintf()". Since that patch is
obviously not contained in libnftnl-1.0.8, this one should not be
applied until nftables-v0.8 has been released.
---
 src/netlink.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/src/netlink.c b/src/netlink.c
index d5d410a847624..c9859ef151213 100644
--- a/src/netlink.c
+++ b/src/netlink.c
@@ -520,13 +520,11 @@ void netlink_dump_rule(const struct nftnl_rule *nlr, struct netlink_ctx *ctx)
 void netlink_dump_expr(const struct nftnl_expr *nle,
 		       FILE *fp, unsigned int debug_mask)
 {
-	char buf[4096];
-
 	if (!(debug_mask & DEBUG_NETLINK))
 		return;
 
-	nftnl_expr_snprintf(buf, sizeof(buf), nle, 0, 0);
-	fprintf(fp, "%s\n", buf);
+	nftnl_expr_fprintf(fp, nle, 0, 0);
+	fprintf(fp, "\n");
 }
 
 static int list_rule_cb(struct nftnl_rule *nlr, void *arg)
-- 
2.13.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [nft PATCH] netlink: Use nftnl_expr_fprintf() in netlink_dump_expr()
  2017-10-04 21:41 [nft PATCH] netlink: Use nftnl_expr_fprintf() in netlink_dump_expr() Phil Sutter
@ 2017-10-17 13:20 ` Pablo Neira Ayuso
  0 siblings, 0 replies; 2+ messages in thread
From: Pablo Neira Ayuso @ 2017-10-17 13:20 UTC (permalink / raw)
  To: Phil Sutter; +Cc: netfilter-devel

On Wed, Oct 04, 2017 at 11:41:11PM +0200, Phil Sutter wrote:
> This gets rid of the temporary buffer.

Applied, thanks.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2017-10-17 13:20 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-10-04 21:41 [nft PATCH] netlink: Use nftnl_expr_fprintf() in netlink_dump_expr() Phil Sutter
2017-10-17 13:20 ` Pablo Neira Ayuso

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.