mirror of
https://gitlab.com/shorewall/code.git
synced 2024-11-24 00:23:28 +01:00
Simplify add_rule()
git-svn-id: https://shorewall.svn.sourceforge.net/svnroot/shorewall/trunk@6989 fbd18981-670d-0410-9b5c-8dc0c1a9a2bb
This commit is contained in:
parent
fcbac7b242
commit
d621ca52fa
@ -407,12 +407,12 @@ sub add_rule($$)
|
|||||||
|
|
||||||
$iprangematch = 0;
|
$iprangematch = 0;
|
||||||
|
|
||||||
|
$rule .= qq( -m comment --comment "$comment") if $comment;
|
||||||
|
|
||||||
if ( $chainref->{cmdmode} ) {
|
if ( $chainref->{cmdmode} ) {
|
||||||
$rule =~ s/"/\\"/g; #Must preserve quotes in the rule
|
$rule =~ s/"/\\"/g; #Must preserve quotes in the rule
|
||||||
$rule .= " -m comment --comment \\\"$comment\\\"" if $comment;
|
|
||||||
add_command $chainref , qq(echo "-A $chainref->{name} $rule" >&3);
|
add_command $chainref , qq(echo "-A $chainref->{name} $rule" >&3);
|
||||||
} else {
|
} else {
|
||||||
$rule .= " -m comment --comment \"$comment\"" if $comment;
|
|
||||||
push @{$chainref->{rules}}, join( ' ', '-A' , $chainref->{name}, $rule );
|
push @{$chainref->{rules}}, join( ' ', '-A' , $chainref->{name}, $rule );
|
||||||
$chainref->{referenced} = 1;
|
$chainref->{referenced} = 1;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user