More state rule check fixes.

Signed-off-by: Tom Eastep <teastep@shorewall.net>
This commit is contained in:
Tom Eastep 2013-02-03 18:02:02 -08:00
parent c5dc69b750
commit f1707d2ace

View File

@ -2687,19 +2687,18 @@ sub check_state( $ ) {
} }
} else { } else {
if ( ( $state eq 'ESTABLISHED' ) || if ( ( $state eq 'ESTABLISHED' ) ||
( $state =~ /^(?:INVALID|UNTRACKED|RELATED)$/ && $globals{"${state}_DISPOSITION"} ) ) { ( $state =~ /^(?:INVALID|UNTRACKED|RELATED)$/ && $globals{"${state}_TARGET"} ) ) {
my $sections = $actparms{0}->{sections}; my $sectionref = $actparms{0}->{sections};
if ( $sections ) { if ( $sectionref ) {
my $sectionnumber = ( $section_map{$state} || 0 ); return 0 if $sectionref->{$state};
return 0 if $sectionnumber & $sections;
} }
} }
if ( $section & ( NEW_SECTION | DEFAULTACTION_SECTION ) ) { if ( $section & ( NEW_SECTION | DEFAULTACTION_SECTION ) ) {
return ( $state =~ /^(?:INVALID|UNTRACKED|NEW)$/ ); return ( $state =~ /^(?:INVALID|UNTRACKED|NEW)$/ );
} else { } else {
return 2 if $state eq $section_rmap{$section}; return $state eq $section_rmap{$section} ? 2 : 1;
} }
} }
} }