forked from extern/shorewall_code
Don't let move_rules() duplicate rules
git-svn-id: https://shorewall.svn.sourceforge.net/svnroot/shorewall/trunk@9057 fbd18981-670d-0410-9b5c-8dc0c1a9a2bb
This commit is contained in:
parent
fd2f961b55
commit
0d6c4309da
@ -541,17 +541,25 @@ sub move_rules( $$ ) {
|
|||||||
|
|
||||||
if ( $chain1->{referenced} ) {
|
if ( $chain1->{referenced} ) {
|
||||||
my @rules = @{$chain1->{rules}};
|
my @rules = @{$chain1->{rules}};
|
||||||
|
my @newrules;
|
||||||
|
|
||||||
for ( @rules ) {
|
RULE:
|
||||||
fatal_error "Internal Error in move_rules()" unless /^-A/;
|
for my $rule ( @rules ) {
|
||||||
|
fatal_error "Internal Error in move_rules()" unless $rule =~ /^-A/;
|
||||||
|
for ( @{$chain2->{rules}} ) {
|
||||||
|
next RULE if $rule eq $_;
|
||||||
|
}
|
||||||
|
push @newrules, $rule;
|
||||||
}
|
}
|
||||||
|
|
||||||
splice @{$chain2->{rules}}, 0, 0, @rules;
|
if ( @newrules ) {
|
||||||
|
splice @{$chain2->{rules}}, 0, 0, @newrules;
|
||||||
|
|
||||||
$chain2->{referenced} = 1;
|
$chain2->{referenced} = 1;
|
||||||
$chain1->{referenced} = 0;
|
$chain1->{referenced} = 0;
|
||||||
$chain1->{rules} = [];
|
$chain1->{rules} = [];
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#
|
#
|
||||||
|
Loading…
Reference in New Issue
Block a user