Clean up COMMENT feature

git-svn-id: https://shorewall.svn.sourceforge.net/svnroot/shorewall/trunk@4654 fbd18981-670d-0410-9b5c-8dc0c1a9a2bb
This commit is contained in:
teastep 2006-10-09 22:05:48 +00:00
parent 9926048484
commit 8437d79d73
2 changed files with 8 additions and 17 deletions

View File

@ -884,10 +884,8 @@ setup_tc1() {
expandv mark sources dests proto ports sports user testval length tos
if [ "x$mark" = xCOMMENT ]; then
if [ -n "$COMMENTS" ]; then
echo $sources $dests $proto $ports $sports $user $testval $length $tos | while read COMMENT; do
save_command COMMENT=\"$COMMENT\"
done
comment=Yes
comment=$(echo $sources $dests $proto $ports $sports $user $testval $length $tos)
save_command COMMENT=\"${comment% }\"
else
error_message "COMMENT ignored -- requires comment support in iptables/Netfilter"
fi
@ -1023,11 +1021,8 @@ __EOF__
while read mark sources dests proto ports sports user testval; do
if [ "x$mark" = xCOMMENT ]; then
if [ -n "$COMMENTS" ]; then
[ -n "$COMMENTS" ] || fatal_error "COMMENT requires comment support in iptables/Netfilter"
echo $sources $dests $proto $ports $sports $user $testval $length $tos | while read COMMENT; do
save_command COMMENT=\"$COMMENT\"
done
comment=Yes
comment=$(echo $sources $dests $proto $ports $sports $user $testval $length $tos)
save_command COMMENT=\"${comment% }\"
else
error_message "COMMENT ignored -- requires comment support in iptables/Netfilter"
fi
@ -2753,10 +2748,8 @@ process_rules()
;;
COMMENT)
if [ -n "$COMMENTS" ]; then
echo $xclients $xservers $xprotocol $xports $xcports $xaddress $xratelimit $xuserspec | while read COMMENT; do
save_command COMMENT=\"$COMMENT\"
done
comment=Yes
comment=$(echo $xclients $xservers $xprotocol $xports $xcports $xaddress $xratelimit $xuserspec)
save_command COMMENT=\"${comment% }\"
else
error_message "COMMENT ignored -- requires comment support in iptables/Netfilter"
fi

View File

@ -435,10 +435,8 @@ __EOF__
if [ -n "$NAT_ENABLED" ]; then
if [ "x$fullinterface" = xCOMMENT ]; then
if [ -n "$COMMENTS" ]; then
echo $networks $addresses $proto $ports $ipsec | while read COMMENT; do
save_command COMMENT=\"$COMMENT\"
done
comment=Yes
comment=$(echo $networks $addresses $proto $ports $ipsec)
save_command COMMENT=\"${comment% }\"
else
error_message "COMMENT ignored -- requires comment support in iptables/Netfilter"
fi