Eliminate forward declaration of finish_chain_section()

Signed-off-by: Tom Eastep <teastep@shorewall.net>
This commit is contained in:
Tom Eastep 2013-01-24 09:04:50 -08:00
parent c2bc74cdfe
commit a40c74ddec

View File

@ -836,36 +836,6 @@ sub optimize_policy_chains() {
# Modules moved from the Chains module in 4.4.18 # Modules moved from the Chains module in 4.4.18
################################################################################ ################################################################################
sub finish_chain_section( $$$ );
#
# Create a rules chain if necessary and populate it with the appropriate ESTABLISHED,RELATED rule(s) and perform SYN rate limiting.
#
# Return a reference to the chain's table entry.
#
sub ensure_rules_chain( $ )
{
my ($chain) = @_;
my $chainref = $filter_table->{$chain};
$chainref = new_rules_chain( $chain ) unless $chainref;
unless ( $chainref->{referenced} ) {
if ( $section & ( NEW_SECTION | DEFAULTACTION_SECTION ) ) {
finish_chain_section $chainref , $chainref, 'ESTABLISHED,RELATED,INVALID';
} elsif ( $section == INVALID_SECTION ) {
finish_chain_section $chainref , $chainref, 'ESTABLISHED,RELATED';
} elsif ( $section == RELATED_SECTION ) {
finish_chain_section $chainref , $chainref, 'ESTABLISHED';
}
$chainref->{referenced} = 1;
}
$chainref;
}
# #
# Add ESTABLISHED,RELATED,INVALID rules and synparam jumps to the passed chain # Add ESTABLISHED,RELATED,INVALID rules and synparam jumps to the passed chain
# #
@ -991,6 +961,34 @@ sub finish_chain_section ($$$) {
pop_comment( $save_comment ); pop_comment( $save_comment );
} }
#
# Create a rules chain if necessary and populate it with the appropriate ESTABLISHED,RELATED rule(s) and perform SYN rate limiting.
#
# Return a reference to the chain's table entry.
#
sub ensure_rules_chain( $ )
{
my ($chain) = @_;
my $chainref = $filter_table->{$chain};
$chainref = new_rules_chain( $chain ) unless $chainref;
unless ( $chainref->{referenced} ) {
if ( $section & ( NEW_SECTION | DEFAULTACTION_SECTION ) ) {
finish_chain_section $chainref , $chainref, 'ESTABLISHED,RELATED,INVALID';
} elsif ( $section == INVALID_SECTION ) {
finish_chain_section $chainref , $chainref, 'ESTABLISHED,RELATED';
} elsif ( $section == RELATED_SECTION ) {
finish_chain_section $chainref , $chainref, 'ESTABLISHED';
}
$chainref->{referenced} = 1;
}
$chainref;
}
# #
# Do section-end processing # Do section-end processing
# #