From ebbf381e27f74f878bed3c190ee3ee379ab1e0cf Mon Sep 17 00:00:00 2001 From: Tom Eastep Date: Mon, 20 Dec 2010 10:32:04 -0800 Subject: [PATCH] Rename %logactionchains -> %usedactions --- Shorewall/Perl/Shorewall/Actions.pm | 14 +++++++------- Shorewall/Perl/Shorewall/Providers.pm | 2 +- Shorewall/Perl/Shorewall/Rules.pm | 14 ++------------ 3 files changed, 10 insertions(+), 20 deletions(-) diff --git a/Shorewall/Perl/Shorewall/Actions.pm b/Shorewall/Perl/Shorewall/Actions.pm index 32d2373c2..604ed66f6 100644 --- a/Shorewall/Perl/Shorewall/Actions.pm +++ b/Shorewall/Perl/Shorewall/Actions.pm @@ -43,7 +43,7 @@ our @EXPORT = qw( process_actions2 %actions - %logactionchains + %usedactions %default_actions ); our @EXPORT_OK = qw( initialize ); @@ -66,7 +66,7 @@ our %actions; # # Contains an entry for each used :[:] that maps to the associated chain. # -our %logactionchains; +our %usedactions; our $family; @@ -88,7 +88,7 @@ sub initialize( $ ) { ACCEPT => 'none' , QUEUE => 'none' ); %actions = (); - %logactionchains = (); + %usedactions = (); } # @@ -188,7 +188,7 @@ sub createlogactionchain( $$$$$ ) { $chain = substr( $chain, 0, 27 ), redo CHECKDUP if ( $actionref->{actchain} || 0 ) >= 10 and length $chain == 28; } - $logactionchains{$normalized} = $chainref = new_standard_chain '%' . $chain . $actionref->{actchain}++; + $usedactions{$normalized} = $chainref = new_standard_chain '%' . $chain . $actionref->{actchain}++; fatal_error "Too many invocations of Action $action" if $actionref->{actchain} > 99; @@ -218,7 +218,7 @@ sub createsimpleactionchain( $ ) { my $action = shift; my $chainref = new_standard_chain $action; - $logactionchains{"$action:none::"} = $chainref; + $usedactions{"$action:none::"} = $chainref; unless ( $targets{$action} & BUILTIN ) { @@ -268,7 +268,7 @@ sub createactionchain( $ ) { sub use_action( $ ) { my $normalized = shift; - if ( $logactionchains{$normalized} ) { + if ( $usedactions{$normalized} ) { 0; } else { createactionchain $normalized; @@ -307,7 +307,7 @@ sub process_actions2 () { while ( $changed ) { $changed = 0; - for my $target (keys %logactionchains) { + for my $target (keys %usedactions) { my ( $action, $level, $tag, $param ) = split ':', $target; my $actionref = $actions{$action}; assert( $actionref ); diff --git a/Shorewall/Perl/Shorewall/Providers.pm b/Shorewall/Perl/Shorewall/Providers.pm index 5e953d9ff..002c60cc7 100644 --- a/Shorewall/Perl/Shorewall/Providers.pm +++ b/Shorewall/Perl/Shorewall/Providers.pm @@ -275,7 +275,7 @@ sub add_a_provider( ) { require_capability 'REALM_MATCH', "Configuring multiple providers through one interface", "s"; } - fatal_error "Unknown Interface ($interface)" unless known_interface( $interface, 1 ); + fatal_error "Unknown Interface ($interface)" unless known_interface( $interface ); fatal_error "A bridge port ($interface) may not be configured as a provider interface" if port_to_bridge $interface; my $physical = get_physical $interface; diff --git a/Shorewall/Perl/Shorewall/Rules.pm b/Shorewall/Perl/Shorewall/Rules.pm index d13706466..7d44b97f8 100644 --- a/Shorewall/Perl/Shorewall/Rules.pm +++ b/Shorewall/Perl/Shorewall/Rules.pm @@ -240,16 +240,6 @@ sub map_old_actions( $ ) { } } -# -# Find the chain that handles the passed action. If the chain cannot be found, -# a fatal error is generated and the function does not return. -# -sub find_logactionchain( $ ) { - my $fullaction = $_[0]; - - fatal_error "Fatal error in find_logactionchain" unless $logactionchains{$fullaction}; -} - # # The functions process_actions1-3() implement the three phases of action processing. # @@ -553,7 +543,7 @@ sub process_actions3 () { 'forwardUPnP' => \&forwardUPnP, 'Limit' => \&Limit, ); - while ( my ( $wholeaction, $chainref ) = each %logactionchains ) { + while ( my ( $wholeaction, $chainref ) = each %usedactions ) { my ( $action, $level, $tag, $param ) = split /:/, $wholeaction; if ( $targets{$action} & BUILTIN ) { @@ -1228,7 +1218,7 @@ sub process_rule_common ( $$$$$$$$$$$$$$$$ ) { unless ( $actiontype & NATONLY ) { if ( $actiontype & ACTION ) { - $action = (find_logactionchain $normalized_target)->{name}; + $action = $usedactions{$normalized_target}{name}; $loglevel = ''; }