forked from extern/shorewall_code
Don't accept rates of zero; accept 'bps'
git-svn-id: https://shorewall.svn.sourceforge.net/svnroot/shorewall/trunk@8465 fbd18981-670d-0410-9b5c-8dc0c1a9a2bb
This commit is contained in:
parent
dd8f738a58
commit
5052246e9c
@ -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 $rate / 125 if $rate =~ /^\d+$/;
|
||||
return $1 / 125 if $rate =~ /^(\d+)(bps)?$/;
|
||||
fatal_error "Invalid Rate ($rate)";
|
||||
}
|
||||
|
||||
@ -411,6 +411,7 @@ sub convert_rate( $$$ ) {
|
||||
$rate = rate_to_kbit $rate
|
||||
}
|
||||
|
||||
fatal_error "$column may not be zero" unless $rate;
|
||||
fatal_error "$column ($_[1]) exceeds OUT-BANDWIDTH" if $rate > $full;
|
||||
|
||||
$rate;
|
||||
|
Loading…
Reference in New Issue
Block a user