Apply optimize category 16 again after 8 if 8 did anything

Signed-off-by: Tom Eastep <teastep@shorewall.net>
This commit is contained in:
Tom Eastep 2018-02-27 14:15:35 -08:00
parent c3d8cba042
commit 34c5441768
No known key found for this signature in database
GPG Key ID: 96E6B3F2423A4D10

View File

@ -4563,16 +4563,22 @@ sub valid_tables() {
sub optimize_ruleset() { sub optimize_ruleset() {
my $optimize = $config{OPTIMIZE};
for my $table ( valid_tables ) { for my $table ( valid_tables ) {
my $tableref = $chain_table{$table}; my $tableref = $chain_table{$table};
my $passes = 0; my $passes = 0;
my $optimize = $config{OPTIMIZE};
$passes = optimize_level4( $table, $tableref ) if $optimize & 4; $passes = optimize_level4( $table, $tableref ) if $optimize & 4;
$passes = optimize_level16( $table, $tableref , $passes ) if $optimize & 16; $passes = optimize_level16( $table, $tableref , $passes ) if $optimize & 16;
my $savepasses = $passes;
$passes = optimize_level8( $table, $tableref , $passes ) if $optimize & 8; $passes = optimize_level8( $table, $tableref , $passes ) if $optimize & 8;
$passes = optimize_level16( $table, $tableref , $passes ) if $optimize & 16 && $passes > $savepasses + 1;
progress_message " Table $table Optimized -- Passes = $passes"; progress_message " Table $table Optimized -- Passes = $passes";
progress_message ''; progress_message '';
} }