From a4a00d572f188f1dab38d24ccf4337900ccabe21 Mon Sep 17 00:00:00 2001
From: teastep <teastep@fbd18981-670d-0410-9b5c-8dc0c1a9a2bb>
Date: Tue, 20 Mar 2007 00:06:56 +0000
Subject: [PATCH] Get Tc Working

git-svn-id: https://shorewall.svn.sourceforge.net/svnroot/shorewall/trunk@5587 fbd18981-670d-0410-9b5c-8dc0c1a9a2bb
---
 New/Shorewall/Tc.pm | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/New/Shorewall/Tc.pm b/New/Shorewall/Tc.pm
index e817c084b..ceb4d118c 100644
--- a/New/Shorewall/Tc.pm
+++ b/New/Shorewall/Tc.pm
@@ -32,6 +32,7 @@ use Shorewall::Common;
 use Shorewall::Config;
 use Shorewall::Zones;
 use Shorewall::Chains;
+use Shorewall::Interfaces;
 
 use strict;
 
@@ -307,7 +308,7 @@ sub validate_tc_device( $$$ ) {
     fatal_error "Invalid device name ( $device ) in tcdevice \"$line\"" if $device =~ /[:+]/;
 
     $tcdevices{$device} = {};
-    $tcdevices{$device}{in_bandsidth}  = rate_to_kbit $inband;
+    $tcdevices{$device}{in_bandwidth}  = rate_to_kbit $inband;
     $tcdevices{$device}{out_bandwidth} = rate_to_kbit $outband;
     
     push @tcdevices, $device;
@@ -318,7 +319,7 @@ sub convert_rate( $$ ) {
 
     $rate =~ s/\bfull\b/$full/g;
 
-    int( $rate );
+    eval "int( $rate )";
 }
 
 sub validate_tc_class( $$$$$$ ) {
@@ -436,7 +437,7 @@ sub setup_traffic_shaping() {
 	emit "${dev}_mtu=\$(get_device_mtu $device)";
 	emit qq(run_tc "class add dev $device parent $devnum: classid $devnum:1 htb rate $devref->{out_bandwidth} mtu \$${dev}_mtu");
 	
-	my $inband = rate_to_kbit $devref->{in_band};
+	my $inband = rate_to_kbit $devref->{in_bandwidth};
 
 	if ( $inband ) {
 	    emit "run_tc add dev $device handle ffff: ingress";