Improve editing of LIMIT/BURST

git-svn-id: https://shorewall.svn.sourceforge.net/svnroot/shorewall/trunk@6216 fbd18981-670d-0410-9b5c-8dc0c1a9a2bb
This commit is contained in:
teastep 2007-05-03 16:56:05 +00:00
parent 04064d01e6
commit 83d7df107d

View File

@ -914,10 +914,12 @@ sub do_ratelimit( $$ ) {
fatal_error "Rate Limiting not available with $action" if $norate{$action};
if ( $rate =~ /^([^:]+):([^:]+)$/ ) {
"-m limit --limit $1 --limit-burst $2 ";
} else {
if ( $rate =~ /^(\d+(\/(sec|hour|day)))?:(\d+)$/ ) {
"-m limit --limit $1 --limit-burst $4 ";
} elsif ( $rate =~ /^(\d+)(\/(sec|hour|day))?$/ ) {
"-m limit --limit $rate ";
} else {
fatal_error "Invalid rate ($rate)";
}
}