push(@ratelimit_options, ("--connlimit-mask", "32"));
# Apply the limit
- push(@ratelimit_options, ("--connlimit-upto", $conn_limit));
+ if ($target eq "ACCEPT") {
+ push(@ratelimit_options, ("--connlimit-upto", $conn_limit));
+ } else {
+ push(@ratelimit_options, ("--connlimit-above", $conn_limit));
+ }
}
}
push(@ratelimit_options, ("--hashlimit-name", "rule-$key"));
push(@ratelimit_options, ("--hashlimit-mode", "srcip"));
- push(@ratelimit_options, ("--hashlimit-upto", $rate_limit));
+ if ($target eq "ACCEPT") {
+ push(@ratelimit_options, ("--hashlimit-upto", $rate_limit));
+ } else {
+ push(@ratelimit_options, ("--hashlimit-above", $rate_limit));
+ }
}
}