From c15c2869168d71d07aca0221e1b37f0c5da54547 Mon Sep 17 00:00:00 2001 From: Florian Westphal Date: Tue, 6 Nov 2018 16:06:26 +0100 Subject: xt: pass octx to translate function We can't use it when no translation is available as libxtables will use plain printf(), but when translation is available we can. Signed-off-by: Florian Westphal --- src/xt.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/xt.c') diff --git a/src/xt.c b/src/xt.c index 74763d58..30d8690a 100644 --- a/src/xt.c +++ b/src/xt.c @@ -26,7 +26,7 @@ #include #include -void xt_stmt_xlate(const struct stmt *stmt) +void xt_stmt_xlate(const struct stmt *stmt, struct output_ctx *octx) { struct xt_xlate *xl = xt_xlate_alloc(10240); @@ -40,7 +40,7 @@ void xt_stmt_xlate(const struct stmt *stmt) }; stmt->xt.match->xlate(xl, ¶ms); - printf("%s", xt_xlate_get(xl)); + nft_print(octx, "%s", xt_xlate_get(xl)); } else if (stmt->xt.match->print) { printf("#"); stmt->xt.match->print(&stmt->xt.entry, @@ -57,7 +57,7 @@ void xt_stmt_xlate(const struct stmt *stmt) }; stmt->xt.target->xlate(xl, ¶ms); - printf("%s", xt_xlate_get(xl)); + nft_print(octx, "%s", xt_xlate_get(xl)); } else if (stmt->xt.target->print) { printf("#"); stmt->xt.target->print(NULL, stmt->xt.target->t, 0); -- cgit v1.2.3