From 613e41c25a3a76f244669bbf29baf567abe77450 Mon Sep 17 00:00:00 2001 From: Tom Eastep Date: Fri, 25 Nov 2011 16:05:07 -0800 Subject: [PATCH] Enable OPT 16 in check -r; Suppress duplicate rules --- Shorewall/Perl/Shorewall/Chains.pm | 2 ++ Shorewall/Perl/Shorewall/Compiler.pm | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) 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;