mirror of
https://gitlab.com/shorewall/code.git
synced 2024-11-08 16:54:10 +01:00
A small optimization on the last restriction removal
This commit is contained in:
parent
84bff13e7f
commit
76d9a80df3
@ -422,15 +422,16 @@ sub add_commands ( $$;@ ) {
|
||||
}
|
||||
|
||||
sub push_rule( $$ ) {
|
||||
my ($chainref, $rule) = @_;
|
||||
my $chainref = $_[0];
|
||||
my $rule = join( ' ', '-A', $chainref->{name} , $_[1]);
|
||||
|
||||
$rule .= qq( -m comment --comment "$comment") if $comment;
|
||||
|
||||
if ( $chainref->{cmdlevel} ) {
|
||||
$rule =~ s/"/\\"/g; #Must preserve quotes in the rule
|
||||
add_commands $chainref , qq(echo "-A $chainref->{name} $rule" >&3);
|
||||
add_commands $chainref , qq(echo "$rule" >&3);
|
||||
} else {
|
||||
push @{$chainref->{rules}}, join( ' ', '-A' , $chainref->{name}, $rule );
|
||||
push @{$chainref->{rules}}, $rule;
|
||||
$chainref->{referenced} = 1;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user