mirror of
https://gitlab.com/shorewall/code.git
synced 2025-06-25 12:13:29 +02:00
Allow TOS to work on RHEL5
Signed-off-by: Tom Eastep <teastep@shorewall.net>
This commit is contained in:
parent
bd56caf74f
commit
287a44be52
@ -4101,7 +4101,7 @@ sub decode_tos( $$ ) {
|
|||||||
$mask = numeric_value $2;
|
$mask = numeric_value $2;
|
||||||
} elsif ( ! defined ( $value = numeric_value( $tos ) ) ) {
|
} elsif ( ! defined ( $value = numeric_value( $tos ) ) ) {
|
||||||
$value = $tosmap{$tos};
|
$value = $tosmap{$tos};
|
||||||
$mask = 0x3f;
|
$mask = '';
|
||||||
}
|
}
|
||||||
|
|
||||||
fatal_error( [ 'Invalid TOS column value',
|
fatal_error( [ 'Invalid TOS column value',
|
||||||
@ -4109,12 +4109,15 @@ sub decode_tos( $$ ) {
|
|||||||
'Invalid TOS() parameter', ]->[$set] . " ($tos)" )
|
'Invalid TOS() parameter', ]->[$set] . " ($tos)" )
|
||||||
unless ( defined $value &&
|
unless ( defined $value &&
|
||||||
$value <= 0xff &&
|
$value <= 0xff &&
|
||||||
defined $mask &&
|
( $mask eq '' ||
|
||||||
$mask <= 0xff );
|
( 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 ";
|
$set ? " --set-tos $tos" : "-m tos --tos $tos ";
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user