From 0b2b7935fcc77249744903cf8bdbf2c5252cdf9e Mon Sep 17 00:00:00 2001 From: teastep Date: Wed, 3 May 2006 21:05:13 +0000 Subject: [PATCH] Allow hex numbers in 'mark' column of the providers file == Take 3 git-svn-id: https://shorewall.svn.sourceforge.net/svnroot/shorewall/trunk@3852 fbd18981-670d-0410-9b5c-8dc0c1a9a2bb --- Shorewall/compiler | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/Shorewall/compiler b/Shorewall/compiler index 540173ede..08f7b6de7 100755 --- a/Shorewall/compiler +++ b/Shorewall/compiler @@ -1105,9 +1105,9 @@ verify_mark() # $1 = value to test { verify_mark1() { - [ $1 -lt 256 ] && return 0 + [ $(($1)) -lt 256 ] && return 0 [ -n "$HIGH_ROUTE_MARKS" ] || return 1 - [ $1 -gt 65535 ] && return 1 + [ $(($1)) -gt 65535 ] && return 1 return $(($1 & 0XFF)) } @@ -3065,8 +3065,12 @@ setup_traffic_shaping() fatal_error "device $device seems not to be configured in tcdevices" fi list_search "$device-$mark" $classlist && fatal_error "Mark $mark for interface $device defined more than once in tcclasses" + # + # Convert HEX/OCTAL mark representation to decimal + # + mark=$(($mark)) verify_mark $mark - [ $(($mark)) -lt 256 ] || fatal_error "Invalid Mark Value" + [ $mark -lt 256 ] || fatal_error "Invalid Mark Value" classlist="$classlist $device-$mark" done < $TMP_DIR/tcclasses }