From 1b1911a2d04824b46007af13eec239dff1d961d8 Mon Sep 17 00:00:00 2001 From: teastep Date: Tue, 20 Mar 2007 01:34:59 +0000 Subject: [PATCH] More traffic shaping progress git-svn-id: https://shorewall.svn.sourceforge.net/svnroot/shorewall/trunk@5590 fbd18981-670d-0410-9b5c-8dc0c1a9a2bb --- New/Shorewall/Tc.pm | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/New/Shorewall/Tc.pm b/New/Shorewall/Tc.pm index a5d8e03c6..a9fdd2292 100644 --- a/New/Shorewall/Tc.pm +++ b/New/Shorewall/Tc.pm @@ -421,7 +421,7 @@ sub setup_traffic_shaping() { close TC; - my $devnum = 0; + my $devnum = 1; $prefix = '10' if @tcdevices > 10; @@ -439,13 +439,14 @@ sub setup_traffic_shaping() { emit "${dev}_exists=Yes"; emit "qt tc qdisc del dev $device root"; emit "qt tc qdisc del dev $device ingress"; + emit "run_tc qdisc add dev $device root handle $devnum: htb default ${prefix}${defmark}"; emit "${dev}_mtu=\$(get_device_mtu $device)"; emit "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_bandwidth}; if ( $inband ) { - emit "run_tc add dev $device handle ffff: ingress"; + emit "run_tc qdisc add dev $device handle ffff: ingress"; emit "run_tc filter add dev $device parent ffff: protocol ip prio 50 u32 match ip src 0.0.0.0/0 police rate ${inband} burst 10k drop flowid :1"; }