Catch absurd MARK contents

git-svn-id: https://shorewall.svn.sourceforge.net/svnroot/shorewall/trunk@8430 fbd18981-670d-0410-9b5c-8dc0c1a9a2bb
This commit is contained in:
teastep 2008-04-18 00:43:23 +00:00
parent aee1f94ce4
commit c7db0435eb

View File

@ -1231,11 +1231,17 @@ sub do_test ( $$ )
{
my ($testval, $mask) = @_;
my $originaltestval = $testval;
return '' unless defined $testval and $testval ne '-';
$mask = '' unless defined $mask;
my $invert = $testval =~ s/^!// ? '! ' : '';
my $match = $testval =~ s/:C$// ? "-m connmark ${invert}--mark" : "-m mark ${invert}--mark";
fatal_error "Invalid MARK value ($originaltestval)" if $testval eq '/';
validate_mark $testval;
$testval = join( '/', $testval, in_hex($mask) ) unless ( $testval =~ '/' );