diff --git a/Shorewall/Perl/Shorewall/Chains.pm b/Shorewall/Perl/Shorewall/Chains.pm index f208e0ad4..97ebf57e7 100644 --- a/Shorewall/Perl/Shorewall/Chains.pm +++ b/Shorewall/Perl/Shorewall/Chains.pm @@ -1783,7 +1783,7 @@ sub optimize_ruleset() { next if not @$rules; CHAIN: for my $chainref1 ( grep $_->{referenced}, values %{$chain_table{$table}} ) { - next if $chainref->{name} eq $chainref1->{name}; + next if $chainref eq $chainref1; my $rules1 = $chainref1->{rules}; next if @$rules != @$rules1; next if $chainref1->{dont_delete};