mirror of
https://gitlab.com/shorewall/code.git
synced 2025-06-20 09:47:51 +02:00
Delete optimize_okay() and add a couple of assertions
This commit is contained in:
parent
5634b08e22
commit
6f00f2127c
@ -43,7 +43,6 @@ our @EXPORT = qw(
|
|||||||
ensure_manual_chain
|
ensure_manual_chain
|
||||||
log_rule_limit
|
log_rule_limit
|
||||||
dont_optimize
|
dont_optimize
|
||||||
optimize_okay
|
|
||||||
dont_delete
|
dont_delete
|
||||||
dont_move
|
dont_move
|
||||||
|
|
||||||
@ -660,6 +659,8 @@ sub add_reference ( $$ ) {
|
|||||||
|
|
||||||
my $toref = reftype $to ? $to : $chain_table{$fromref->{table}}{$to};
|
my $toref = reftype $to ? $to : $chain_table{$fromref->{table}}{$to};
|
||||||
|
|
||||||
|
assert($toref);
|
||||||
|
|
||||||
$toref->{references}{$fromref->{name}}++;
|
$toref->{references}{$fromref->{name}}++;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -671,6 +672,8 @@ sub delete_reference( $$ ) {
|
|||||||
|
|
||||||
my $toref = reftype $to ? $to : $chain_table{$fromref->{table}}{$to};
|
my $toref = reftype $to ? $to : $chain_table{$fromref->{table}}{$to};
|
||||||
|
|
||||||
|
assert( $toref );
|
||||||
|
|
||||||
delete $toref->{references}{$fromref->{name}} unless --$toref->{references}{$fromref->{name}} > 0;
|
delete $toref->{references}{$fromref->{name}} unless --$toref->{references}{$fromref->{name}} > 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1259,21 +1262,6 @@ sub dont_optimize( $ ) {
|
|||||||
$chainref;
|
$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
|
# Set the dont_optimize and dont_delete flags for a chain
|
||||||
#
|
#
|
||||||
|
Loading…
x
Reference in New Issue
Block a user