update ar7 config, disable watchdog for now (closes: #2146)
[openwrt.git] / package / qos-scripts / files / usr / lib / qos / generate.sh
index 64e2fc6..a531e28 100755 (executable)
@@ -116,6 +116,14 @@ parse_matching_rule() {
                                add_insmod ipt_connbytes
                                append "$var" "-m connbytes --connbytes $value --connbytes-dir both --connbytes-mode bytes"
                        ;;
+                       *:direction)
+                               value="$(echo "$value" | sed -e 's,-,:,g')"
+                               if [ "$value" = "out" ]; then
+                                       append "$var" "-o $device"
+                               elif [ "$value" = "in" ]; then
+                                       append "$var" "-i $device"
+                               fi
+                       ;;
                        1:pktsize)
                                value="$(echo "$value" | sed -e 's,-,:,g')"
                                add_insmod ipt_length
@@ -239,7 +247,6 @@ start_interface() {
        config_get device "$iface" device
        config_get_bool enabled "$iface" enabled 1
        [ -z "$device" -o 1 -ne "$enabled" ] && {
-               echo "Interface '$iface' not found or disabled."
                return 1 
        }
        config_get upload "$iface" upload
@@ -253,7 +260,7 @@ start_interface() {
        for dir in up${halfduplex} ${download:+down}; do
                case "$dir" in
                        up)
-                               [ "$overhead" = 1 ] && upload=$(($upload * 98 / 100 - (32 * 128 / $upload)))
+                               [ "$overhead" = 1 ] && upload=$(($upload * 98 / 100 - (15 * 128 / $upload)))
                                dev="$device"
                                rate="$upload"
                                dl_mode=""
@@ -357,6 +364,7 @@ start_cg() {
                                append down "iptables -t mangle -A POSTROUTING -o $device -j IMQ --todev $imqdev" "$N"
                        }
                        append down "iptables -t mangle -A PREROUTING -i $device -j ${cg}" "$N"
+                       append down "iptables -t mangle -A POSTROUTING -o $device -j ${cg}" "$N"
                        append down "iptables -t mangle -A PREROUTING -i $device -j IMQ --todev $imqdev" "$N"
                }
        done
This page took 0.023963 seconds and 4 git commands to generate.