From 4cf650c4276540a8405e53b3f29d759c080465b5 Mon Sep 17 00:00:00 2001 From: Phil Sutter Date: Thu, 23 Aug 2018 17:43:28 +0200 Subject: ebtables-translate: Fix for libebt_limit.txlate The xlate function sharing here does not quite work since in ebtables-translate, extensions are supposed to append whitespace. Fix this by introducing a simple wrapper. Signed-off-by: Phil Sutter Signed-off-by: Pablo Neira Ayuso --- extensions/libxt_limit.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'extensions') diff --git a/extensions/libxt_limit.c b/extensions/libxt_limit.c index 124bda29..c7b66295 100644 --- a/extensions/libxt_limit.c +++ b/extensions/libxt_limit.c @@ -195,6 +195,14 @@ static int limit_xlate(struct xt_xlate *xl, return 1; } +static int limit_xlate_eb(struct xt_xlate *xl, + const struct xt_xlate_mt_params *params) +{ + limit_xlate(xl, params); + xt_xlate_add(xl, " "); + return 1; +} + #define FLAG_LIMIT 0x01 #define FLAG_LIMIT_BURST 0x02 #define ARG_LIMIT '1' @@ -276,7 +284,7 @@ static struct xtables_match limit_match[] = { .parse = brlimit_parse, .print = brlimit_print, .extra_opts = brlimit_opts, - .xlate = limit_xlate, + .xlate = limit_xlate_eb, }, }; -- cgit v1.2.3