Changeset 28731


Ignore:
Timestamp:
2011-11-03T20:11:01+01:00 (6 years ago)
Author:
jow
Message:

[package] qos-scripts: only use the lower 8 bits for firewall marks, allows coexistence with other programs like nodogsplash - patch by Tobias Wolf (#10096)

Location:
trunk/package/qos-scripts
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/package/qos-scripts/Makefile

    r26622 r28731  
    1010PKG_NAME:=qos-scripts 
    1111PKG_VERSION:=1.2.1 
    12 PKG_RELEASE:=5 
     12PKG_RELEASE:=6 
    1313 
    1414PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME) 
  • trunk/package/qos-scripts/files/usr/lib/qos/generate.sh

    r28623 r28731  
    5454        config_get type "$section" TYPE 
    5555        case "$type" in 
    56                 classify) unset pkt; append "$var" "-m mark --mark 0";; 
    57                 default) pkt=1; append "$var" "-m mark --mark 0";; 
     56                classify) unset pkt; append "$var" "-m mark --mark 0/0xff";; 
     57                default) pkt=1; append "$var" "-m mark --mark 0/0xff";; 
    5858                reclassify) pkt=1;; 
    5959        esac 
     
    162162                                [ -z "$class" ] && continue; 
    163163                                case "$value" in 
    164                                         !*) append "$var" "-m mark ! --mark $class";; 
    165                                         *) append "$var" "-m mark --mark $class";; 
     164                                        !*) append "$var" "-m mark ! --mark $class/0xff";; 
     165                                        *) append "$var" "-m mark --mark $class/0xff";; 
    166166                                esac 
    167167                        ;; 
     
    387387                } 
    388388 
    389                 parse_matching_rule iptrule "$rule" "$options" "$prefix" "-j MARK --set-mark $target" 
     389                parse_matching_rule iptrule "$rule" "$options" "$prefix" "-j MARK --set-mark $target/0xff" 
    390390                append "$var" "$iptrule" "$N" 
    391391        done 
     
    405405                [ -z "$maxsize" -o -z "$mark" ] || { 
    406406                        add_insmod ipt_length 
    407                         append pktrules "iptables -t mangle -A qos_${cg} -m mark --mark $mark -m length --length $maxsize: -j MARK --set-mark 0" "$N" 
     407                        append pktrules "iptables -t mangle -A qos_${cg} -m mark --mark $mark/0xff -m length --length $maxsize: -j MARK --set-mark 0/0xff" "$N" 
    408408                } 
    409409        done 
     
    424424iptables -t mangle -N qos_${cg} >&- 2>&- 
    425425iptables -t mangle -N qos_${cg}_ct >&- 2>&- 
    426 ${iptrules:+${iptrules}${N}iptables -t mangle -A qos_${cg}_ct -j CONNMARK --save-mark} 
    427 iptables -t mangle -A qos_${cg} -j CONNMARK --restore-mark 
    428 iptables -t mangle -A qos_${cg} -m mark --mark 0 -j qos_${cg}_ct 
     426${iptrules:+${iptrules}${N}iptables -t mangle -A qos_${cg}_ct -j CONNMARK --save-mark --mask 0xff} 
     427iptables -t mangle -A qos_${cg} -j CONNMARK --restore-mark --mask 0xff 
     428iptables -t mangle -A qos_${cg} -m mark --mark 0/0xff -j qos_${cg}_ct 
    429429$pktrules 
    430430$up$N${down:+${down}$N} 
  • trunk/package/qos-scripts/files/usr/lib/qos/tcrules.awk

    r26622 r28731  
    123123        # filter rule 
    124124        for (i = 1; i <= n; i++) { 
    125                 print "tc filter add dev "device" parent 1: prio "class[i]" protocol ip handle "class[i]" fw flowid 1:"class[i] "0"  
     125                print "tc filter add dev "device" parent 1: prio "class[i]" protocol ip handle "class[i]"/0xff fw flowid 1:"class[i] "0"  
    126126                filterc=1 
    127127                if (filter[i] != "") { 
Note: See TracChangeset for help on using the changeset viewer.