Allow 'sec' as a valid unit of time in rate-limit specifications

git-svn-id: https://shorewall.svn.sourceforge.net/svnroot/shorewall/trunk@6998 fbd18981-670d-0410-9b5c-8dc0c1a9a2bb
This commit is contained in:
teastep 2007-07-29 18:09:00 +00:00
parent 283f489063
commit 0d6d0c1c0f
3 changed files with 7 additions and 2 deletions

View File

@ -21,6 +21,8 @@ Changes in 4.0.1
10) Cleaner way to handle quotes in rules.
11) Allow '/min' in RATE/BURST column.
Changes in 4.0.0 Final
1) Fix lite install.sh manpage problem.

View File

@ -78,6 +78,9 @@ Problems corrected in 4.0.1.
actions and when a log level followed by '!' was used with any
builtin actions.
10) Shorewall-perl was incorrectly rejecting 'min' as a valid unit of
time in rate-limiting specifications.
Other changes in Shorewall 4.0.1.
1) A new EXPAND_POLICIES option is added to shorewall.conf. The

View File

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