Add TOS handling to tcrules processing

git-svn-id: https://shorewall.svn.sourceforge.net/svnroot/shorewall/trunk@5607 fbd18981-670d-0410-9b5c-8dc0c1a9a2bb
This commit is contained in:
teastep 2007-03-21 16:43:42 +00:00
parent 8f82d7f161
commit 319bea7308
2 changed files with 11 additions and 1 deletions

View File

@ -84,6 +84,7 @@ our @EXPORT = qw( STANDARD
do_test do_test
do_ratelimit do_ratelimit
do_user do_user
do_tos
iprange_match iprange_match
match_source_net match_source_net
match_dest_net match_dest_net
@ -806,6 +807,15 @@ sub do_user( $ ) {
$rule; $rule;
} }
#
# Create a "-m tos" match for the passed TOS[/MASK]
#
sub do_tos( $ ) {
my $tos = $_[0];
$tos && $tos ne '-' ? "-m tos --tos $tos " : '';
}
# #
# Avoid generating a second '-m iprange' in a single rule. # Avoid generating a second '-m iprange' in a single rule.
# #

View File

@ -207,7 +207,7 @@ sub process_tc_rule( $$$$$$$$$$ ) {
expand_rule expand_rule
ensure_chain( 'mangle' , $chain ) , ensure_chain( 'mangle' , $chain ) ,
NO_RESTRICT , NO_RESTRICT ,
do_proto( $proto, $ports, $sports) . do_test( $testval, $mask ) , do_proto( $proto, $ports, $sports) . do_test( $testval, $mask ) . do_tos( $tos ) ,
$source , $source ,
$dest , $dest ,
'' , '' ,