From 622abc73b097e7e778b432e422fd3c1f035bcfd3 Mon Sep 17 00:00:00 2001 From: Massimo Maggi Date: Wed, 15 Jun 2011 02:52:00 +0200 Subject: libxt_RATEEST: fix userspacesize field I cannot delete a rule by matching it if the target of the rule is RATEEST. Copy-paste from terminal: # iptables -t mangle -A PREROUTING -j RATEEST --rateest-name somename --rateest-interval 250ms --rateest-ewmalog 4s # iptables -t mangle -D PREROUTING -j RATEEST --rateest-name somename --rateest-interval 250ms --rateest-ewmalog 4s iptables: No chain/target/match by that name. I saw in comments of the kernel code that the last part of the struct xt_rateest_target_info is used only by kernel: struct xt_rateest_target_info { char name[IFNAMSIZ]; __s8 interval; __u8 ewma_log; /* Used internally by the kernel */ struct xt_rateest *est __attribute__((aligned(8))); }; but in struct xtables_target, .size and .userspacesize are equal. Simply correcting this solved the problem. References: http://bugzilla.netfilter.org/show_bug.cgi?id=724 Signed-off-by: Jan Engelhardt --- extensions/libxt_RATEEST.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'extensions') diff --git a/extensions/libxt_RATEEST.c b/extensions/libxt_RATEEST.c index 62bcb5e8..acdefb90 100644 --- a/extensions/libxt_RATEEST.c +++ b/extensions/libxt_RATEEST.c @@ -167,7 +167,7 @@ static struct xtables_target rateest_tg_reg = { .name = "RATEEST", .version = XTABLES_VERSION, .size = XT_ALIGN(sizeof(struct xt_rateest_target_info)), - .userspacesize = XT_ALIGN(sizeof(struct xt_rateest_target_info)), + .userspacesize = offsetof(struct xt_rateest_target_info, est), .help = RATEEST_help, .x6_parse = RATEEST_parse, .x6_fcheck = RATEEST_final_check, -- cgit v1.2.3