mirror of
https://gitlab.com/shorewall/code.git
synced 2024-12-24 15:18:53 +01:00
Fix Optimization Bug
Signed-off-by: Tom Eastep <teastep@shorewall.net>
This commit is contained in:
parent
ff5f2ab15a
commit
50ce5bab68
@ -174,7 +174,7 @@ our %EXPORT_TAGS = (
|
||||
|
||||
Exporter::export_ok_tags('internal');
|
||||
|
||||
our $VERSION = '4.4_9';
|
||||
our $VERSION = '4.4_10';
|
||||
|
||||
#
|
||||
# Chain Table
|
||||
@ -736,6 +736,15 @@ sub adjust_reference_counts( $$$ ) {
|
||||
}
|
||||
}
|
||||
|
||||
#
|
||||
# Adjust reference counts after copying a rule from $name1 to $name2
|
||||
#
|
||||
sub adjust_reference_counts1( $$$ ) {
|
||||
my ($toref, $name1, $name2) = @_;
|
||||
|
||||
$toref->{references}{$name2}++ if $toref;
|
||||
}
|
||||
|
||||
#
|
||||
# Move the rules from one chain to another
|
||||
#
|
||||
@ -799,8 +808,6 @@ sub copy_rules( $$ ) {
|
||||
#
|
||||
$name1 =~ s/\+/\\+/;
|
||||
|
||||
( s/\-([AI]) $name1(\b)/-$1 ${name2}$2/ ) for @rules;
|
||||
|
||||
my $last = pop @$rules; # Delete the jump to chain1
|
||||
|
||||
if ( $debug ) {
|
||||
@ -809,7 +816,7 @@ sub copy_rules( $$ ) {
|
||||
}
|
||||
|
||||
for ( @rules ) {
|
||||
adjust_reference_counts( $tableref->{$1}, $name1, $name2 ) if / -[jg] ([^\s]+)/;
|
||||
adjust_reference_counts1( $tableref->{$1}, $name1, $name2 ) if / -[jg] ([^\s]+)/;
|
||||
}
|
||||
|
||||
push @$rules, @rules;
|
||||
@ -1640,8 +1647,7 @@ sub conditionally_move_rules( $$ ) {
|
||||
# Move is safe -- start with an empty rule list
|
||||
#
|
||||
$chainref->{rules} = [];
|
||||
my $count = move_rules( $targetref, $chainref );
|
||||
progress_message " $count rules moved from chain $targetref->{name} to chain $chainref->{name}" if $count;
|
||||
copy_rules( $targetref, $chainref );
|
||||
1;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user