Modify optimization 8 loop to continue until no chains are combined.

Signed-off-by: Tom Eastep <teastep@shorewall.net>
This commit is contained in:
Tom Eastep 2010-04-16 09:17:57 -07:00
parent 8e1284f74c
commit e7a4aaafc1

View File

@ -1777,7 +1777,7 @@ sub optimize_ruleset() {
while ( $progress ) {
$progress = 0;
$passes++;
for my $chainref ( grep $_->{referenced} && ! $_->{builtin}, values %{$chain_table{$table}} ) {
my $rules = $chainref->{rules};
next if not @$rules;
@ -1791,7 +1791,7 @@ sub optimize_ruleset() {
for ( my $i = 0; $i <= $#$rules; $i++ ) {
next CHAIN unless $rules->[$i] eq $rules1->[$i];
}
replace_references1 $chainref1, $chainref->{name}, '';
$progress = 1;
}