Fix for HIGH_ROUTE_MARKS=Yes

git-svn-id: https://shorewall.svn.sourceforge.net/svnroot/shorewall/trunk@3856 fbd18981-670d-0410-9b5c-8dc0c1a9a2bb
This commit is contained in:
teastep 2006-05-03 22:39:24 +00:00
parent 412766ba52
commit f0004152b7

View File

@ -3187,6 +3187,8 @@ setup_traffic_shaping()
# #
process_tc_rule() process_tc_rule()
{ {
local did_connmark=
chain=$MARKING_CHAIN target="MARK --set-mark" marktest= chain=$MARKING_CHAIN target="MARK --set-mark" marktest=
verify_designator() { verify_designator() {
@ -3219,6 +3221,13 @@ process_tc_rule()
[ $(($1)) -lt 256 ] || fatal_error "Mark Value ($1) too larg, rule \"$rule\"" [ $(($1)) -lt 256 ] || fatal_error "Mark Value ($1) too larg, rule \"$rule\""
} }
do_connmark()
{
target="CONNMARK --set-mark"
mark=$mark/0xff
did_connmark=Yes
}
add_a_tc_rule() { add_a_tc_rule() {
r= r=
@ -3276,6 +3285,7 @@ process_tc_rule()
esac esac
fi fi
[ -n "$marktest" ] && r="${r}-m ${marktest}--mark $testval " [ -n "$marktest" ] && r="${r}-m ${marktest}--mark $testval "
if [ "x$dest" != "x-" ]; then if [ "x$dest" != "x-" ]; then
@ -3345,18 +3355,18 @@ process_tc_rule()
;; ;;
cp|CP) cp|CP)
verify_designator tcpre verify_designator tcpre
target="CONNMARK --set-mark" do_connmark
;; ;;
f|F) f|F)
verify_designator tcfor verify_designator tcfor
;; ;;
cf|CF) cf|CF)
verify_designator tcfor verify_designator tcfor
target="CONNMARK --set-mark" do_connmark
;; ;;
c|C) c|C)
target="CONNMARK --set-mark"
mark=${mark%:*} mark=${mark%:*}
do_connmark
;; ;;
*) *)
chain=tcpost chain=tcpost
@ -3368,24 +3378,29 @@ process_tc_rule()
case $mark in case $mark in
SAVE) SAVE)
[ -n $did_connmark ] && fatal_error "SAVE not valid with :C[FP]"
target="CONNMARK --save-mark --mask 0xFF" target="CONNMARK --save-mark --mask 0xFF"
mark= mark=
;; ;;
SAVE/*) SAVE/*)
[ -n $did_connmark ] && fatal_error "SAVE not valid with :C[FP]"
target="CONNMARK --save-mark --mask" target="CONNMARK --save-mark --mask"
mark=${mark#*/} mark=${mark#*/}
verify_small_mark $mark verify_small_mark $mark
;; ;;
RESTORE) RESTORE)
[ -n $did_connmark ] && fatal_error "RESTORE not valid with :C[FP]"
target="CONNMARK --restore-mark --mask 0xFF" target="CONNMARK --restore-mark --mask 0xFF"
mark= mark=
;; ;;
RESTORE/*) RESTORE/*)
[ -n $did_connmark ] && fatal_error "RESTORE not valid with :C[FP]"
target="CONNMARK --restore-mark --mask" target="CONNMARK --restore-mark --mask"
mark=${mark#*/} mark=${mark#*/}
verify_small_mark $mark verify_small_mark $mark
;; ;;
CONTINUE) CONTINUE)
[ -n $did_connmark ] && fatal_error "CONTINUE not valid with :C[FP]"
target=RETURN target=RETURN
mark= mark=
;; ;;