mirror of
https://gitlab.com/shorewall/code.git
synced 2024-11-22 23:53:30 +01:00
Eliminate globals{STATEMATCH}
Signed-off-by: Tom Eastep <teastep@shorewall.net>
This commit is contained in:
parent
6803ce5d41
commit
18e7e43b2f
@ -77,6 +77,8 @@ our @EXPORT = ( qw(
|
||||
dont_delete
|
||||
dont_move
|
||||
add_interface_options
|
||||
state_match
|
||||
state_imatch
|
||||
|
||||
STANDARD
|
||||
NATRULE
|
||||
|
@ -662,8 +662,7 @@ sub initialize( $;$$) {
|
||||
TC_SCRIPT => '',
|
||||
EXPORT => 0,
|
||||
KLUDGEFREE => '',
|
||||
STATEMATCH => '-m state --state',
|
||||
VERSION => "4.5.18-Beta1",
|
||||
VERSION => "4.5.19-Beta1",
|
||||
CAPVERSION => 40515 ,
|
||||
);
|
||||
#
|
||||
@ -5108,7 +5107,6 @@ sub get_configuration( $$$$ ) {
|
||||
%used = ();
|
||||
|
||||
if ( have_capability 'CONNTRACK_MATCH') {
|
||||
$globals{STATEMATCH} = '-m conntrack --ctstate';
|
||||
$used{CONNTRACK_MATCH} = REQUIRED;
|
||||
} else {
|
||||
$used{STATE_MATCH} = REQUIRED;
|
||||
|
@ -2283,7 +2283,7 @@ sub generate_matrix() {
|
||||
'' ,
|
||||
'' ,
|
||||
'insert' ,
|
||||
"$globals{STATEMATCH} NEW ";
|
||||
state_match('NEW');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -2609,7 +2609,7 @@ sub process_rule ( $$$$$$$$$$$$$$$$$$$ ) {
|
||||
}
|
||||
|
||||
fatal_error "$basictarget rules are not allowed in the $section_rmap{$section} SECTION" if $actiontype & ( NATRULE | NONAT );
|
||||
$rule .= "$globals{STATEMATCH} ESTABLISHED " if $section == ESTABLISHED_SECTION;
|
||||
$rule .= state_match('ESTABLISHED') if $section == ESTABLISHED_SECTION;
|
||||
}
|
||||
#
|
||||
# Generate CT rules(s), if any
|
||||
|
@ -2446,7 +2446,7 @@ sub process_secmark_rule1( $$$$$$$$$ ) {
|
||||
if ( ( $state ||= '' ) ne '' ) {
|
||||
my $state1;
|
||||
fatal_error "Invalid STATE ( $state )" unless $state1 = $state{$state};
|
||||
$state = "$globals{STATEMATCH} $state1 ";
|
||||
$state = state_match( $state1 );
|
||||
}
|
||||
|
||||
my $target = $secmark eq 'SAVE' ? 'CONNSECMARK --save' :
|
||||
|
@ -41,7 +41,7 @@ use Shorewall::Rules;
|
||||
my ( $action ) = get_action_params( 1 );
|
||||
|
||||
if ( my $check = check_state( 'ESTABLISHED' ) ) {
|
||||
perl_action_helper( $action, $check == 1 ? "$globals{STATEMATCH} ESTABLISHED" : '', 'ESTABLISHED' );
|
||||
perl_action_helper( $action, $check == 1 ? state_match('ESTABLISHED') : '', 'ESTABLISHED' );
|
||||
}
|
||||
|
||||
1;
|
||||
|
@ -46,7 +46,7 @@ if ( supplied $audit ) {
|
||||
}
|
||||
|
||||
if ( my $check = check_state( 'INVALID' ) ) {
|
||||
perl_action_helper( $action, $check == 1 ? "$globals{STATEMATCH} INVALID" : '' , 'INVALID' );
|
||||
perl_action_helper( $action, $check == 1 ? state_match( 'INVALID' ) : '' , 'INVALID' );
|
||||
}
|
||||
|
||||
1;
|
||||
|
@ -41,7 +41,7 @@ use Shorewall::Rules;
|
||||
my ( $action ) = get_action_params( 1 );
|
||||
|
||||
if ( my $check = check_state( 'NEW' ) ) {
|
||||
perl_action_helper( $action, $check == 1 ? "$globals{STATEMATCH} NEW" : '' , 'NEW' );
|
||||
perl_action_helper( $action, $check == 1 ? state_match( 'NEW' ) : '' , 'NEW' );
|
||||
}
|
||||
|
||||
1;
|
||||
|
@ -42,7 +42,7 @@ use Shorewall::Rules;
|
||||
my ( $action ) = get_action_params( 1 );
|
||||
|
||||
if ( my $check = check_state( 'RELATED' ) ) {
|
||||
perl_action_helper( $action, $check == 1 ? "$globals{STATEMATCH} RELATED" : '', 'RELATED' );
|
||||
perl_action_helper( $action, $check == 1 ? state_match( 'RELATED' ) : '', 'RELATED' );
|
||||
}
|
||||
|
||||
1;
|
||||
|
@ -41,7 +41,7 @@ use Shorewall::Rules;
|
||||
my ( $action ) = get_action_params( 1 );
|
||||
|
||||
if ( my $check = check_state( 'UNTRACKED' ) ) {
|
||||
perl_action_helper( $action, $check == 1 ? "$globals{STATEMATCH} UNTRACKED" : '' , 'UNTRACKED' );
|
||||
perl_action_helper( $action, $check == 1 ? state_match( 'UNTRACKED' ) : '' , 'UNTRACKED' );
|
||||
}
|
||||
|
||||
1;
|
||||
|
Loading…
Reference in New Issue
Block a user