Allow TOS to work on RHEL5

Signed-off-by: Tom Eastep <teastep@shorewall.net>
This commit is contained in:
Tom Eastep 2012-03-19 09:22:21 -07:00
parent bd56caf74f
commit 287a44be52

View File

@ -4101,7 +4101,7 @@ sub decode_tos( $$ ) {
$mask = numeric_value $2;
} elsif ( ! defined ( $value = numeric_value( $tos ) ) ) {
$value = $tosmap{$tos};
$mask = 0x3f;
$mask = '';
}
fatal_error( [ 'Invalid TOS column value',
@ -4109,12 +4109,15 @@ sub decode_tos( $$ ) {
'Invalid TOS() parameter', ]->[$set] . " ($tos)" )
unless ( defined $value &&
$value <= 0xff &&
defined $mask &&
$mask <= 0xff );
( $mask eq '' ||
( defined $mask &&
$mask <= 0xff ) ) );
warning_message "Unmatchable TOS ($tos)" unless $set || $value & $mask;
unless ( $mask eq '' ) {
warning_message "Unmatchable TOS ($tos)" unless $set || $value & $mask;
}
$tos = in_hex( $value) . '/' . in_hex( $mask ) . ' ';
$tos = $mask ? in_hex( $value) . '/' . in_hex( $mask ) . ' ' : in_hex( $value ) . ' ';
$set ? " --set-tos $tos" : "-m tos --tos $tos ";