From 6f61293b08a32ce52d89ba477d1c256cf068b1bd Mon Sep 17 00:00:00 2001 From: Tom Eastep Date: Fri, 30 Dec 2011 10:27:58 -0800 Subject: [PATCH] Reduce the size of many configs by not copying long chains multiple times. Signed-off-by: Tom Eastep --- Shorewall/Perl/Shorewall/Chains.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Shorewall/Perl/Shorewall/Chains.pm b/Shorewall/Perl/Shorewall/Chains.pm index 9ed86bdc7..1bc40026a 100644 --- a/Shorewall/Perl/Shorewall/Chains.pm +++ b/Shorewall/Perl/Shorewall/Chains.pm @@ -2783,7 +2783,7 @@ sub optimize_level4( $$ ) { # Last rule is a simple branch my $targetref = $tableref->{$lastrule->{target}}; - if ( $targetref && ! ( $targetref->{builtin} || $targetref->{dont_move} ) ) { + if ( $targetref && ! ( $targetref->{builtin} || $targetref->{dont_move} ) && ( keys %{$targetref->{references}} < 2 || @{$targetref->{rules}} < 4 ) ) { copy_rules( $targetref, $chainref ); $progress = 1; }