From: Phil Sutter Date: Thu, 23 Aug 2018 15:43:28 +0000 (+0200) Subject: ebtables-translate: Fix for libebt_limit.txlate X-Git-Tag: v1.8.1~57 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4cf650c4276540a8405e53b3f29d759c080465b5;p=thirdparty%2Fiptables.git 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 --- 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, }, };