Make 'check -r' work like 'compile' WRT optimization

Signed-off-by: Tom Eastep <teastep@shorewall.net>
This commit is contained in:
Tom Eastep 2012-06-03 15:15:11 -07:00
parent 621aa3fc6a
commit 28f0a066da
2 changed files with 7 additions and 5 deletions

View File

@ -112,6 +112,7 @@ our %EXPORT_TAGS = (
ALL_COMMANDS
NOT_RESTORE
OPTIMIZE_POLICY_MASK
OPTIMIZE_POLICY_MASK1
OPTIMIZE_RULESET_MASK
OPTIMIZE_MASK
@ -368,6 +369,7 @@ use constant { ALL_COMMANDS => 1, NOT_RESTORE => 2 };
#
use constant {
OPTIMIZE_POLICY_MASK => 0x02 , # Call optimize_policy_chains()
OPTIMIZE_POLICY_MASK1 => 0x06 ,
OPTIMIZE_RULESET_MASK => 0x1C , # Call optimize_ruleset()
};

View File

@ -817,11 +817,11 @@ sub compiler {
#
# Optimize Policy Chains
#
optimize_policy_chains if $optimize & 6 == 2; # Level 2 but not 4
optimize_policy_chains if ( $optimize & OPTIMIZE_POLICY_MASK1 ) == OPTIMIZE_POLICY_MASK; # Level 2 but not 4
#
# More Optimization
#
optimize_ruleset if $config{OPTIMIZE} & 0x1C;
optimize_ruleset if $config{OPTIIMIZE} & OPTIMIZE_RULESET_MASK;
}
enable_script;
@ -877,16 +877,16 @@ sub compiler {
optimize_level0;
if ( $config{OPTIMIZE} & OPTIMIZE_MASK ) {
if ( ( my $optimize = $config{OPTIMIZE} & OPTIMIZE_MASK ) ) {
progress_message2 'Optimizing Ruleset...';
#
# Optimize Policy Chains
#
optimize_policy_chains if $config{OPTIMIZE} & OPTIMIZE_POLICY_MASK;
optimize_policy_chains if ( $optimize & OPTIMIZE_POLICY_MASK1 ) == OPTIMIZE_POLICY_MASK; # Level 2 but not 4
#
# Ruleset Optimization
#
optimize_ruleset if $config{OPTIMIZE} & OPTIMIZE_RULESET_MASK;
optimize_ruleset if $optimize & OPTIMIZE_RULESET_MASK;
}
enable_script if $debug;