From c635cc9c9e9ce87b49d6fcbf1e796a0896b9905b 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 c88dfe321..6d9511a40 100644 --- a/Shorewall/Perl/Shorewall/Chains.pm +++ b/Shorewall/Perl/Shorewall/Chains.pm @@ -2780,7 +2780,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; }