mirror of
https://gitlab.com/shorewall/code.git
synced 2024-12-16 19:30:44 +01:00
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:
parent
04064d01e6
commit
83d7df107d
@ -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)";
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user