forked from extern/shorewall_code
Adjust reference counts when splicing in short chain
Signed-off-by: Tom Eastep <teastep@shorewall.net>
This commit is contained in:
parent
fdc45a990d
commit
8487c78a0a
@ -3010,9 +3010,16 @@ sub optimize_level4( $$ ) {
|
|||||||
if ( $_->{simple} && ( $_->{target} || '' ) eq $name ) {
|
if ( $_->{simple} && ( $_->{target} || '' ) eq $name ) {
|
||||||
trace( $sourceref, 'D', $rulenum + 1, $_ ) if $debug;
|
trace( $sourceref, 'D', $rulenum + 1, $_ ) if $debug;
|
||||||
splice @$rulesref, $rulenum, 1, @{$chainref->{rules}};
|
splice @$rulesref, $rulenum, 1, @{$chainref->{rules}};
|
||||||
if ( $debug ) {
|
while ( my $ruleref = shift @{$chainref->{rules}} ) {
|
||||||
while ( my $ruleref = shift @{$chainref->{rules}} ) {
|
trace ( $sourceref, 'I', $rulenum++, $ruleref ) if $debug;
|
||||||
trace ( $sourceref, 'I', $rulenum++, $ruleref );
|
my $target = $ruleref->{target};
|
||||||
|
|
||||||
|
if ( $target && ( my $targetref = $tableref->{$target} ) ) {
|
||||||
|
#
|
||||||
|
# The rule target is a chain
|
||||||
|
#
|
||||||
|
add_reference( $chainref, $targetref );
|
||||||
|
delete_reference( $sourceref, $targetref );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -3021,7 +3028,6 @@ sub optimize_level4( $$ ) {
|
|||||||
last;
|
last;
|
||||||
}
|
}
|
||||||
$rulenum++;
|
$rulenum++;
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user