Fix the malfunction filter deleting
authorNeutron Soutmun <neo.neutron@gmail.com>
Wed, 26 Nov 2008 07:22:20 +0000 (14:22 +0700)
committerNeutron Soutmun <neo.neutron@gmail.com>
Wed, 26 Nov 2008 07:22:20 +0000 (14:22 +0700)
2008-11-26  Neutron Soutmun <neo.neutron@gmail.com>

* example/rahunas.bandwidth: Fix the script delete all filters rather than
  the specified flowid.

ChangeLog
example/rahunas.bandwidth

index 2b9e667..1ea7069 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,10 @@
 2008-11-26  Neutron Soutmun <neo.neutron@gmail.com>
 
+       * example/rahunas.bandwidth: Fix the script delete all filters rather than 
+         the specified flowid.
+
+2008-11-26  Neutron Soutmun <neo.neutron@gmail.com>
+
        * -rahunas.{init,default,firewall,bandwidth},
          +example/rahunas.{init,default,firewall,bandwidth}:
          Move rahunas.* wrapper scripts to example dir.
index c560488..524c381 100755 (executable)
@@ -92,10 +92,12 @@ bw_del() {
 
   # Filter Removal
   # Downlink/Uplink
-  $TC filter del dev $SHAPING_DOWN_INF parent 1: protocol ip prio 1 u32 \
-    flowid 1:${ID}
-  $TC filter del dev $SHAPING_UP_INF parent 2: protocol ip prio 1 u32 \
-    flowid 2:${ID}
+  DOWN_HANDLE=`$TC filter show dev $SHAPING_DOWN_INF | grep -w "flowid 1:${ID} " | awk '{print $10}'`
+  UP_HANDLE=`$TC filter show dev $SHAPING_UP_INF | grep -w "flowid 2:${ID} " | awk '{print $10}'`
+  $TC filter del dev $SHAPING_DOWN_INF parent 1: \
+    prio 1 handle ${DOWN_HANDLE} u32
+  $TC filter del dev $SHAPING_UP_INF parent 2: \
+    prio 1 handle ${UP_HANDLE} u32
 
   # Class Removal
   # Downlink/Uplink