]> git.ipfire.org Git - people/teissler/ipfire-2.x.git/blobdiff - config/qos/makeqosscripts.pl
qos: fix replacement of fq_codel with htb at qos start.
[people/teissler/ipfire-2.x.git] / config / qos / makeqosscripts.pl
index 122e6b97e031e800769fb7ba163eafbe0c65fd09..202bf4da1c67b900300a92cef58f8ab4aa169461 100644 (file)
@@ -2,7 +2,7 @@
 ###############################################################################
 #                                                                             #
 # IPFire.org - A linux based firewall                                         #
-# Copyright (C) 2010  IPFire Team  <info@ipfire.org>                          #
+# Copyright (C) 2007-2013  IPFire Team  <info@ipfire.org>                     #
 #                                                                             #
 # This program is free software: you can redistribute it and/or modify        #
 # it under the terms of the GNU General Public License as published by        #
@@ -166,6 +166,7 @@ case "\$1" in
        #ip link set dev $qossettings{'RED_DEV'} mtu $qossettings{'MTU'}
 
        ### ADD HTB QDISC FOR $qossettings{'RED_DEV'}
+       tc qdisc del dev $qossettings{'RED_DEV'} root >/dev/null 2>&1
        tc qdisc add dev $qossettings{'RED_DEV'} root handle 1: htb default $qossettings{'DEFCLASS_OUT'}
 
        ### MAIN RATE LIMIT
@@ -224,7 +225,7 @@ foreach $classentry (sort @classes)
        if ($qossettings{'RED_DEV'} eq $classline[0]) {
                $qossettings{'DEVICE'} = $classline[0];
                $qossettings{'CLASS'} = $classline[1];
-               print "\ttc qdisc add dev $qossettings{'DEVICE'} parent 1:$qossettings{'CLASS'} handle $qossettings{'CLASS'}: sfq perturb $qossettings{'SFQ_PERTUB'}\n";
+               print "\ttc qdisc add dev $qossettings{'DEVICE'} parent 1:$qossettings{'CLASS'} handle $qossettings{'CLASS'}: fq_codel\n";
        }
 }
 foreach $subclassentry (sort @subclasses) {
@@ -232,7 +233,7 @@ foreach $subclassentry (sort @subclasses) {
        if ($qossettings{'RED_DEV'} eq $subclassline[0]) {
                $qossettings{'DEVICE'} = $subclassline[0];
                $qossettings{'SCLASS'} = $subclassline[2];
-               print "\ttc qdisc add dev $qossettings{'DEVICE'} parent 1:$qossettings{'SCLASS'} handle $qossettings{'SCLASS'}: sfq perturb $qossettings{'SFQ_PERTUB'}\n";
+               print "\ttc qdisc add dev $qossettings{'DEVICE'} parent 1:$qossettings{'SCLASS'} handle $qossettings{'SCLASS'}: fq_codel\n";
        }
 }
 print "\n\t### FILTER TRAFFIC INTO CLASSES\n";
@@ -423,6 +424,7 @@ print <<END
        # ip link set dev $qossettings{'IMQ_DEV'} mtu $qossettings{'MTU'}
 
        ### ADD HTB QDISC FOR $qossettings{'IMQ_DEV'}
+       tc qdisc del dev $qossettings{'IMQ_DEV'} root >/dev/null 2>&1
        tc qdisc add dev $qossettings{'IMQ_DEV'} root handle 2: htb default $qossettings{'DEFCLASS_INC'}
 
        ### MAIN RATE LIMIT
@@ -693,8 +695,9 @@ print <<END
        killall qosd >/dev/null 2>&1
        (sleep 3 && killall -9 qosd &>/dev/null) &
        # DELETE QDISCS
-       tc qdisc del dev $qossettings{'RED_DEV'} root >/dev/null 2>&1
+       tc qdisc add root dev $qossettings{'RED_DEV'} fq_codel >/dev/null 2>&1
        tc qdisc del dev $qossettings{'IMQ_DEV'} root >/dev/null 2>&1
+       tc qdisc add root dev $qossettings{'IMQ_DEV'} fq_codel >/dev/null 2>&1
        # STOP IMQ-DEVICE
        ip link set $qossettings{'IMQ_DEV'} down >/dev/null 2>&1
        iptables -t mangle --delete POSTROUTING -i $qossettings{'RED_DEV'} -p ah -j RETURN >/dev/null 2>&1