summaryrefslogtreecommitdiffstats
path: root/extensions/libxt_rateest.c
diff options
context:
space:
mode:
authorJan Engelhardt <jengelh@medozas.de>2011-06-21 09:54:31 +0200
committerJan Engelhardt <jengelh@medozas.de>2011-06-21 17:05:11 +0200
commit4a96d2e2c9d8c43b58d9490cd1d2ae2d1b3e0bef (patch)
treeca918ee040fe8a3863952109608b230aa076d395 /extensions/libxt_rateest.c
parent2dba676b68ef842025f3afecba26cb0b2ae4c09b (diff)
libxt_rateest: abolish global variables
Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
Diffstat (limited to 'extensions/libxt_rateest.c')
-rw-r--r--extensions/libxt_rateest.c12
1 files changed, 3 insertions, 9 deletions
diff --git a/extensions/libxt_rateest.c b/extensions/libxt_rateest.c
index 509b3e31..5f42a137 100644
--- a/extensions/libxt_rateest.c
+++ b/extensions/libxt_rateest.c
@@ -8,9 +8,6 @@
#include <xtables.h>
#include <linux/netfilter/xt_rateest.h>
-/* Ugly hack to pass info to final_check function. We should fix the API */
-static struct xt_rateest_match_info *rateest_info;
-
static void rateest_help(void)
{
printf(
@@ -115,8 +112,6 @@ rateest_parse(int c, char **argv, int invert, unsigned int *flags,
struct xt_rateest_match_info *info = (void *)(*match)->data;
unsigned int val;
- rateest_info = info;
-
switch (c) {
case OPT_RATEEST1:
xtables_check_inverse(optarg, &invert, &optind, 0, argv);
@@ -302,10 +297,9 @@ rateest_parse(int c, char **argv, int invert, unsigned int *flags,
return 1;
}
-static void
-rateest_final_check(unsigned int flags)
+static void rateest_final_check(struct xt_fcheck_call *cb)
{
- struct xt_rateest_match_info *info = rateest_info;
+ struct xt_rateest_match_info *info = cb->data;
if (info == NULL)
xtables_error(PARAMETER_PROBLEM, "rateest match: "
@@ -439,7 +433,7 @@ static struct xtables_match rateest_mt_reg = {
.userspacesize = XT_ALIGN(offsetof(struct xt_rateest_match_info, est1)),
.help = rateest_help,
.parse = rateest_parse,
- .final_check = rateest_final_check,
+ .x6_fcheck = rateest_final_check,
.print = rateest_print,
.save = rateest_save,
.extra_opts = rateest_opts,