From cd5be38cfb607b1475954450717ebe374c3b6d04 Mon Sep 17 00:00:00 2001 From: Tom Eastep Date: Wed, 18 Dec 2013 09:19:16 -0800 Subject: [PATCH] Eliminate silly extra loop in accounting processing. Signed-off-by: Tom Eastep --- Shorewall/Perl/Shorewall/Accounting.pm | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/Shorewall/Perl/Shorewall/Accounting.pm b/Shorewall/Perl/Shorewall/Accounting.pm index c06b1ce06..b08570f5f 100644 --- a/Shorewall/Perl/Shorewall/Accounting.pm +++ b/Shorewall/Perl/Shorewall/Accounting.pm @@ -431,16 +431,14 @@ sub process_accounting_rule( ) { 1 ); my $nonempty = 0; - for my $proto ( split_list $protos, 'Protocol' ) { - fatal_error 'ACTION must be specified' if $action eq '-'; + fatal_error 'ACTION must be specified' if $action eq '-'; - if ( $action eq 'SECTION' ) { - section_warning; - process_section( $chain ); - } else { - for my $proto ( split_list $protos, 'Protocol' ) { - $nonempty |= process_accounting_rule1( $action, $chain, $source, $dest, $proto, $ports, $sports, $user, $mark, $ipsec, $headers ); - } + if ( $action eq 'SECTION' ) { + section_warning; + process_section( $chain ); + } else { + for my $proto ( split_list $protos, 'Protocol' ) { + $nonempty |= process_accounting_rule1( $action, $chain, $source, $dest, $proto, $ports, $sports, $user, $mark, $ipsec, $headers ); } }