mirror of
https://gitlab.com/shorewall/code.git
synced 2025-01-26 23:49:08 +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( $$ ) {
|
sub push_rule( $$ ) {
|
||||||
my ($chainref, $rule) = @_;
|
my $chainref = $_[0];
|
||||||
|
my $rule = join( ' ', '-A', $chainref->{name} , $_[1]);
|
||||||
|
|
||||||
$rule .= qq( -m comment --comment "$comment") if $comment;
|
$rule .= qq( -m comment --comment "$comment") if $comment;
|
||||||
|
|
||||||
if ( $chainref->{cmdlevel} ) {
|
if ( $chainref->{cmdlevel} ) {
|
||||||
$rule =~ s/"/\\"/g; #Must preserve quotes in the rule
|
$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 {
|
} else {
|
||||||
push @{$chainref->{rules}}, join( ' ', '-A' , $chainref->{name}, $rule );
|
push @{$chainref->{rules}}, $rule;
|
||||||
$chainref->{referenced} = 1;
|
$chainref->{referenced} = 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user