Don't allow rates > full

git-svn-id: https://shorewall.svn.sourceforge.net/svnroot/shorewall/trunk@8439 fbd18981-670d-0410-9b5c-8dc0c1a9a2bb
This commit is contained in:
teastep 2008-04-19 00:43:34 +00:00
parent 7240cd1e9b
commit 8985536d4b

View File

@ -401,12 +401,15 @@ sub convert_rate( $$ ) {
if ( $rate =~ /\bfull\b/ ) {
$rate =~ s/\bfull\b/$full/g;
progress_message " Compiling $_[1]";
$rate = eval "int( $rate )";
fatal_error "Invalid Rate ($_[1])" unless defined $rate;
} else {
$rate = rate_to_kbit $rate
}
fatal_error "Invalid Rate ($_[1])" if $rate > $full;
"${rate}kbit";
}