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"; }