diff --git a/Shorewall/Perl/Shorewall/Chains.pm b/Shorewall/Perl/Shorewall/Chains.pm index 6ab86e3ac..baef8d69c 100644 --- a/Shorewall/Perl/Shorewall/Chains.pm +++ b/Shorewall/Perl/Shorewall/Chains.pm @@ -774,7 +774,7 @@ sub use_forward_chain($$) { my ( $interface, $chainref ) = @_; my $interfaceref = find_interface($interface); - return 1 if $globals{UNOPTIMIZED} && @{$chainref->{rules}}; + return 1 if @{$chainref->{rules}} && ( $config{OPTIMIZE} & 4096 ); # # We must use the interfaces's chain if the interface is associated with multiple zone nets # @@ -813,7 +813,7 @@ sub use_input_chain($$) { my $interfaceref = find_interface($interface); my $nets = $interfaceref->{nets}; - return 1 if $globals{UNOPTIMIZED} && @{$chainref->{rules}}; + return 1 if @{$chainref->{rules}} && ( $config{OPTIMIZE} & 4096 ); # # We must use the interfaces's chain if: # @@ -870,10 +870,12 @@ sub use_output_chain($$) { my ( $interface, $chainref) = @_; my $interfaceref = find_interface($interface); my $nets = $interfaceref->{nets}; + + return 1 if @{$chainref->{rules}} && ( $config{OPTIMIZE} & 4096 ); # # We must use the interfaces's chain if the interface is associated with multiple zone nets # - return 1 if $nets > 1 || ( $globals{UNOPTIMIZED} && @{$chainref->{rules}} ); + return 1 if $nets > 1; # # Don't need it if it isn't associated with any zone # diff --git a/Shorewall/Perl/Shorewall/Config.pm b/Shorewall/Perl/Shorewall/Config.pm index e403cc8a8..242c27572 100644 --- a/Shorewall/Perl/Shorewall/Config.pm +++ b/Shorewall/Perl/Shorewall/Config.pm @@ -338,7 +338,6 @@ sub initialize( $ ) { TC_SCRIPT => '', EXPORT => 0, UNTRACKED => 0, - UNOPTIMIZED => 0, VERSION => "4.4.8-RC1", CAPVERSION => 40408 , ); @@ -3003,12 +3002,7 @@ sub get_configuration( $ ) { $val = numeric_value $config{OPTIMIZE}; - fatal_error "Invalid OPTIMIZE value ($config{OPTIMIZE})" unless defined( $val ) && $val >= -1 && $val <= 7; - - if ( $val == -1 ) { - $config{OPTIMIZE} = 0; - $globals{UNOPTIMIZED} = 1; - } + fatal_error "Invalid OPTIMIZE value ($config{OPTIMIZE})" unless defined( $val ) && $val >= 0 && ( $val & ( 4096 ^ -1 ) ) <= 7; $globals{MARKING_CHAIN} = $config{MARK_IN_FORWARD_CHAIN} ? 'tcfor' : 'tcpre';