Adjust reference count in move rules.

Signed-off-by: Tom Eastep <teastep@shorewall.net>
This commit is contained in:
Tom Eastep 2010-09-18 15:11:17 -07:00
parent ce9b5ee944
commit c0382b8cb9

View File

@ -762,7 +762,19 @@ sub copy_rules( $$ ) {
my $last = pop @$rules2; # Delete the jump to chain1
if ( $blacklist2 && $blacklist1 ) {
shift @rules1;
#
# Chains2 already has a blacklist jump -- delete the one at the head of chain1's rule list
#
my $rule = shift @rules1;
$rule =~ / -j ([^\s])/;
my $chainb = $1;
assert( $chainb =~ /^black/ );
delete $tableref->{$chainb}{references}{$name1} unless --$tableref->{$chainb}{references}{$name1} > 0;
assert( ! --$chain1->{blacklist} );
$blacklist1 = 0;
}