qos-scripts: Fix generation of IMQ firewall rules on halfduplex mode (#7800)
authorVasilis Tsiligiannis <acinonyx@openwrt.gr>
Mon, 4 Oct 2010 21:25:48 +0000 (21:25 +0000)
committerVasilis Tsiligiannis <acinonyx@openwrt.gr>
Mon, 4 Oct 2010 21:25:48 +0000 (21:25 +0000)
SVN-Revision: 23227

package/qos-scripts/files/usr/lib/qos/generate.sh

index 02c3933d1919e848dd24223c0b328e650831d3e2..6b5db3d7dc0994780857c0f985f954a3f604a4dd 100755 (executable)
@@ -380,7 +380,6 @@ start_cg() {
        local iptrules
        local pktrules
        local sizerules
-       local download
        enum_classes "$cg"
        add_rules iptrules "$ctrules" "iptables -t mangle -A ${cg}_ct"
        config_get classes "$cg" classes
@@ -397,12 +396,14 @@ start_cg() {
                config_get classgroup "$iface" classgroup
                config_get device "$iface" device
                config_get imqdev "$iface" imqdev
-               config_get dl "$iface" download
+               config_get upload "$iface" upload
+               config_get download "$iface" download
                config_get halfduplex "$iface" halfduplex
+               download="${download:-${halfduplex:+$upload}}"
                add_insmod ipt_IMQ
                append up "iptables -t mangle -A OUTPUT -o $device -j ${cg}" "$N"
                append up "iptables -t mangle -A FORWARD -o $device -j ${cg}" "$N"
-               [ -z "$dl" ] || {
+               [ -z "$download" ] || {
                        append down "iptables -t mangle -A POSTROUTING -o $device -j ${cg}" "$N"
                        [ -z "$halfduplex" ] || {
                                append down "iptables -t mangle -A POSTROUTING -o $device -j IMQ --todev $imqdev" "$N"