]> git.ipfire.org Git - thirdparty/iptables.git/commitdiff
ebtables-translate: Fix for libebt_limit.txlate
authorPhil Sutter <phil@nwl.cc>
Thu, 23 Aug 2018 15:43:28 +0000 (17:43 +0200)
committerPablo Neira Ayuso <pablo@netfilter.org>
Fri, 24 Aug 2018 08:05:51 +0000 (10:05 +0200)
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 <phil@nwl.cc>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
extensions/libxt_limit.c

index 124bda2902eb7b8201ff74cbbeadf185cb14be23..c7b66295c09d2d2f16dd3cc84992d2e46798c6b1 100644 (file)
@@ -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,
        },
 };