aboutsummaryrefslogtreecommitdiffstats
path: root/net/bridge/netfilter/ebt_limit.c
diff options
context:
space:
mode:
authorJan Engelhardt <jengelh@medozas.de>2010-03-23 16:35:56 +0100
committerJan Engelhardt <jengelh@medozas.de>2010-03-25 16:55:24 +0100
commitbd414ee605ff3ac5fcd79f57269a897879ee4cde (patch)
tree3cff5d1f3fd43791341e9cde23dabb4dfbc94bd3 /net/bridge/netfilter/ebt_limit.c
parentnetfilter: xtables: change xt_target.checkentry return type (diff)
downloadlinux-dev-bd414ee605ff3ac5fcd79f57269a897879ee4cde.tar.xz
linux-dev-bd414ee605ff3ac5fcd79f57269a897879ee4cde.zip
netfilter: xtables: change matches to return error code
The following semantic patch does part of the transformation: // <smpl> @ rule1 @ struct xt_match ops; identifier check; @@ ops.checkentry = check; @@ identifier rule1.check; @@ check(...) { <... -return true; +return 0; ...> } @@ identifier rule1.check; @@ check(...) { <... -return false; +return -EINVAL; ...> } // </smpl> Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
Diffstat (limited to 'net/bridge/netfilter/ebt_limit.c')
-rw-r--r--net/bridge/netfilter/ebt_limit.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/net/bridge/netfilter/ebt_limit.c b/net/bridge/netfilter/ebt_limit.c
index abfb0ecd7c17..4b0e2e53fa57 100644
--- a/net/bridge/netfilter/ebt_limit.c
+++ b/net/bridge/netfilter/ebt_limit.c
@@ -74,7 +74,7 @@ static int ebt_limit_mt_check(const struct xt_mtchk_param *par)
user2credits(info->avg * info->burst) < user2credits(info->avg)) {
pr_info("overflow, try lower: %u/%u\n",
info->avg, info->burst);
- return false;
+ return -EINVAL;
}
/* User avg in seconds * EBT_LIMIT_SCALE: convert to jiffies * 128. */
@@ -82,7 +82,7 @@ static int ebt_limit_mt_check(const struct xt_mtchk_param *par)
info->credit = user2credits(info->avg * info->burst);
info->credit_cap = user2credits(info->avg * info->burst);
info->cost = user2credits(info->avg);
- return true;
+ return 0;
}