[iptables PATCH 09/10] ebtables-translate: Fix for libebt_limit.txlate

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxx>
---
 extensions/libxt_limit.c | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/extensions/libxt_limit.c b/extensions/libxt_limit.c
index 124bda2902eb7..c7b66295c09d2 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,
 	},
 };
 
-- 
2.18.0




[Index of Archives]     [Netfitler Users]     [LARTC]     [Bugtraq]     [Yosemite Forum]

  Powered by Linux