diff --git a/Shorewall/Perl/Shorewall/Chains.pm b/Shorewall/Perl/Shorewall/Chains.pm index 6ec445d35..80fef7ec8 100644 --- a/Shorewall/Perl/Shorewall/Chains.pm +++ b/Shorewall/Perl/Shorewall/Chains.pm @@ -2944,6 +2944,8 @@ sub combine_dports { next if $baseref->{$key} eq $ruleref->{$key}; last RULE unless $key eq 'multiport' && $multi_sports eq get_multi_sports( $ruleref ); } + + next RULE if $ports1 eq $ports2; last if ( $ports += port_count( $ports2 ) ) > 15; diff --git a/Shorewall/Perl/Shorewall/Compiler.pm b/Shorewall/Perl/Shorewall/Compiler.pm index bc8e1da13..7d10e84ba 100644 --- a/Shorewall/Perl/Shorewall/Compiler.pm +++ b/Shorewall/Perl/Shorewall/Compiler.pm @@ -868,7 +868,7 @@ sub compiler { # generate_matrix; - if ( $config{OPTIMIZE} & 0xE ) { + if ( $config{OPTIMIZE} & 0x1E ) { progress_message2 'Optimizing Ruleset...'; # # Optimize Policy Chains @@ -877,7 +877,7 @@ sub compiler { # # Ruleset Optimization # - optimize_ruleset if $config{OPTIMIZE} & 0xC; + optimize_ruleset if $config{OPTIMIZE} & 0x1C; } enable_script if $debug;