From e4524b7a964152e99452759979a7d3074b5839d7 Mon Sep 17 00:00:00 2001 From: teastep Date: Fri, 10 Nov 2006 19:01:43 +0000 Subject: [PATCH] Don't create ingress qdisc for device with IN-BANDWIDTH == 0 -- Take 2 git-svn-id: https://shorewall.svn.sourceforge.net/svnroot/shorewall/trunk@4832 fbd18981-670d-0410-9b5c-8dc0c1a9a2bb --- Shorewall/Documenation | 5 +++-- Shorewall/lib.tc | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/Shorewall/Documenation b/Shorewall/Documenation index f599bea29..7a944f499 100644 --- a/Shorewall/Documenation +++ b/Shorewall/Documenation @@ -1982,8 +1982,9 @@ Invariant Sections, with no Front-Cover, and with no Back-Cover Texts. You want this mainly if you have a DSL or Cable connection to avoid queuing at your providers side. - If you don't want any traffic to be dropped set this - to a value faster than your interface. + If you don't want any traffic to be dropped, set this + to a value to zero in which case Shorewall will not + create an ingress qdisc. Use kbit or kbps(for Kilobytes per second) for speed, and make sure there is NO space between the diff --git a/Shorewall/lib.tc b/Shorewall/lib.tc index 68c5aac7e..47f40b7cd 100644 --- a/Shorewall/lib.tc +++ b/Shorewall/lib.tc @@ -193,7 +193,7 @@ setup_traffic_shaping() save_command "${dev}_mtu=\$(get_device_mtu $device)" run_tc "class add dev $device parent $devnum: classid $devnum:1 htb rate $outband mtu \$${dev}_mtu" - if [ ${inband} -gt 0 ]; then + if [ $(rate_to_kbit ${inband}) -gt 0 ]; then run_tc qdisc add dev $device handle ffff: ingress 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 fi