diff --git a/Shorewall/Perl/Shorewall/Chains.pm b/Shorewall/Perl/Shorewall/Chains.pm index 4eaaeee02..054882513 100644 --- a/Shorewall/Perl/Shorewall/Chains.pm +++ b/Shorewall/Perl/Shorewall/Chains.pm @@ -43,7 +43,6 @@ our @EXPORT = qw( ensure_manual_chain log_rule_limit dont_optimize - optimize_okay dont_delete dont_move @@ -660,6 +659,8 @@ sub add_reference ( $$ ) { my $toref = reftype $to ? $to : $chain_table{$fromref->{table}}{$to}; + assert($toref); + $toref->{references}{$fromref->{name}}++; } @@ -671,6 +672,8 @@ sub delete_reference( $$ ) { my $toref = reftype $to ? $to : $chain_table{$fromref->{table}}{$to}; + assert( $toref ); + delete $toref->{references}{$fromref->{name}} unless --$toref->{references}{$fromref->{name}} > 0; } @@ -1259,21 +1262,6 @@ sub dont_optimize( $ ) { $chainref; } -# -# Reverse the effect of dont_optimize -# -sub optimize_okay( $ ) { - my $chain = shift; - - my $chainref = reftype $chain ? $chain : $filter_table->{$chain}; - - $chainref->{dont_optimize} = 0; - - trace( $chainref, 'O', undef, '' ) if $debug; - - $chainref; -} - # # Set the dont_optimize and dont_delete flags for a chain #