summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMassimo Maggi <massimo@mmmm.it>2011-06-15 02:52:00 +0200
committerJan Engelhardt <jengelh@medozas.de>2011-06-24 20:01:47 +0200
commit622abc73b097e7e778b432e422fd3c1f035bcfd3 (patch)
tree28d8df1280cc2cc25e116a5ede27ec679fd4e8cb
parentf53710b16c2bae1843c3f5fee390f496dfa82526 (diff)
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 <jengelh@medozas.de>
-rw-r--r--extensions/libxt_RATEEST.c2
1 files changed, 1 insertions, 1 deletions
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,