Fix rate calculation; restore line inadvertently removed yesterday

git-svn-id: https://shorewall.svn.sourceforge.net/svnroot/shorewall/trunk@8471 fbd18981-670d-0410-9b5c-8dc0c1a9a2bb
This commit is contained in:
teastep 2008-04-21 20:09:31 +00:00
parent 69b61dfc55
commit 39eb7a3d1f
2 changed files with 2 additions and 1 deletions

View File

@ -1427,6 +1427,7 @@ sub match_source_net( $;$ ) {
validate_range $addr1, $addr2;
iprange_match . "${invert}--src-range $net ";
} elsif ( $net =~ /^(!?)~(.*)$/ ) {
fatal_error "MAC address cannot be used in this context" if $restriction >= OUTPUT_RESTRICT;
mac_match $net;
} elsif ( $net =~ /^(!?)\+/ ) {
require_capability( 'IPSET_MATCH' , 'ipset names in Shorewall configuration files' , '' );

View File

@ -311,7 +311,7 @@ sub rate_to_kbit( $ ) {
return $1 * 1000 if $rate =~ /^(\d+)mbit$/i;
return $1 * 8000 if $rate =~ /^(\d+)mbps$/i;
return $1 * 8 if $rate =~ /^(\d+)kbps$/i;
return $1 / 125 if $rate =~ /^(\d+)(bps)?$/;
return int($1/125) if $rate =~ /^(\d+)(bps)?$/;
fatal_error "Invalid Rate ($rate)";
}