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:
teastep 2007-07-28 19:17:00 +00:00
parent fcbac7b242
commit d621ca52fa

View File

@ -407,12 +407,12 @@ sub add_rule($$)
$iprangematch = 0;
$rule .= qq( -m comment --comment "$comment") if $comment;
if ( $chainref->{cmdmode} ) {
$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);
} else {
$rule .= " -m comment --comment \"$comment\"" if $comment;
push @{$chainref->{rules}}, join( ' ', '-A' , $chainref->{name}, $rule );
$chainref->{referenced} = 1;
}