From 349bf85c928110b68148b49125967b5a411394d4 Mon Sep 17 00:00:00 2001 From: teastep Date: Mon, 16 Apr 2007 20:11:09 +0000 Subject: [PATCH] Fix non-calculated rates git-svn-id: https://shorewall.svn.sourceforge.net/svnroot/shorewall/trunk@5952 fbd18981-670d-0410-9b5c-8dc0c1a9a2bb --- Shorewall-perl/Shorewall/Tc.pm | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/Shorewall-perl/Shorewall/Tc.pm b/Shorewall-perl/Shorewall/Tc.pm index 5aea1d74e..ddd1f4f79 100644 --- a/Shorewall-perl/Shorewall/Tc.pm +++ b/Shorewall-perl/Shorewall/Tc.pm @@ -293,10 +293,13 @@ sub validate_tc_device( $$$ ) { sub convert_rate( $$ ) { my ($full, $rate) = @_; - $rate =~ s/\bfull\b/$full/g; - - $rate = eval "int( $rate )"; - + if ( $rate =~ /\bfull\b/ ) { + $rate =~ s/\bfull\b/$full/g; + $rate = eval "int( $rate )"; + } else { + $rate = rate_to_kbit $rate + } + "${rate}kbit"; }