mirror of
https://gitlab.com/shorewall/code.git
synced 2024-12-25 07:38:57 +01:00
Correct two problems with tcrules processing:
- SAVE and RESTORE didn't work - '|' and '&' were ignored Signed-off-by: Tom Eastep <teastep@shorewall.net>
This commit is contained in:
parent
0ec4cfd18d
commit
417bd0138e
@ -231,6 +231,8 @@ sub process_mangle_rule1( $$$$$$$$$$$$$$$$$$ ) {
|
|||||||
my ( $option, $marktype ) = @_;
|
my ( $option, $marktype ) = @_;
|
||||||
my $and_or = $1 if $params =~ s/^([|&])//;
|
my $and_or = $1 if $params =~ s/^([|&])//;
|
||||||
|
|
||||||
|
$and_or ||= '';
|
||||||
|
|
||||||
if ( $params =~ /-/ ) {
|
if ( $params =~ /-/ ) {
|
||||||
#
|
#
|
||||||
# A Mark Range
|
# A Mark Range
|
||||||
@ -556,7 +558,7 @@ sub process_mangle_rule1( $$$$$$$$$$$$$$$$$$ ) {
|
|||||||
mask => in_hex( $globals{TC_MASK} ),
|
mask => in_hex( $globals{TC_MASK} ),
|
||||||
function => sub () {
|
function => sub () {
|
||||||
$target = 'MARK';
|
$target = 'MARK';
|
||||||
handle_mark_param('--set-mark', , HIGHMARK );
|
handle_mark_param('', , HIGHMARK );
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
@ -927,21 +929,22 @@ sub process_tc_rule1( $$$$$$$$$$$$$$$$ ) {
|
|||||||
$designator = '';
|
$designator = '';
|
||||||
}
|
}
|
||||||
|
|
||||||
my ( $cmd, $rest );
|
|
||||||
|
|
||||||
if ( $mark =~ /^TOS/ ) {
|
|
||||||
$cmd = $mark;
|
|
||||||
$rest = '';
|
|
||||||
} else {
|
|
||||||
($cmd, $rest) = split( '/', $mark, 2 );
|
|
||||||
}
|
|
||||||
|
|
||||||
unless ( $command ) {
|
unless ( $command ) {
|
||||||
{
|
{
|
||||||
if ( $cmd =~ /^([A-Z]+)/ ) {
|
my ( $cmd, $rest ) = split( '/', $mark, 2 );
|
||||||
|
|
||||||
|
if ( $cmd =~ /^([A-Z]+)(?:\((.+)\))?/ ) {
|
||||||
if ( my $tccmd = $tccmd{$1} ) {
|
if ( my $tccmd = $tccmd{$1} ) {
|
||||||
fatal_error "Invalid $1 ACTION ($originalmark)" unless $tccmd->{match}($cmd);
|
fatal_error "Invalid $1 ACTION ($originalmark)" unless $tccmd->{match}($cmd);
|
||||||
$command = $tccmd->{command} if $tccmd->{command};
|
$command = $1;
|
||||||
|
if ( supplied $rest ) {
|
||||||
|
fatal_error "Invalid $1 ACTION ($originalmark)" if supplied $2;
|
||||||
|
$mark = $rest;
|
||||||
|
} elsif ( supplied $2 ) {
|
||||||
|
$mark = $2;
|
||||||
|
} else {
|
||||||
|
$mark = '';
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
$command = 'MARK';
|
$command = 'MARK';
|
||||||
|
Loading…
Reference in New Issue
Block a user