From 9af4d664dc5c1232093474d3392b1757e00d0f33 Mon Sep 17 00:00:00 2001 From: bbruns Date: Sat, 12 Apr 2014 19:34:27 +0000 Subject: [PATCH] More minor fixes --- lib/iptables.inc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/iptables.inc b/lib/iptables.inc index 5f30dc9..58f2e62 100644 --- a/lib/iptables.inc +++ b/lib/iptables.inc @@ -361,7 +361,7 @@ function enable_forwarding { ([[ ${IP_VERSION} == "ipv6" ]] && [[ ${Enablev6ConnectionTracking} == "yes" ]]) && conntrack_state="${M_STATE} ${C_STATE} ESTABLISHED,RELATED" while read -r action srcinterface srcaddress dstinterface dstaddress bidirectional srcport dstport protocol syn; do [[ ${action} = \#* ]] && continue - [[ ${action} = "" ]] && continue + [[ -z ${action} ]] && continue ([[ ${action} != "ACCEPT" ]] && [[ ${action} != "DROP" ]]) \ && ${display} RED "forward.conf: Error - action must be either ACCEPT or DROP : ${DEFAULT_COLOR}${action} ${srcinterface} ${srcaddress} ${dstinterface} ${dstaddress} ${bidirectional} ${srcport} ${dstport} ${protocol} ${syn}" && continue @@ -389,7 +389,7 @@ function enable_forwarding { [[ ${srcport} != "-" ]] && srcport="--sport ${srcport}" ([[ ${bidirectional} == "yes" ]] && [[ ${srcport} != "-" ]]) && revsrcport="--dport ${srcport}" ([[ ${bidirectional} == "yes" ]] && [[ ${dstport} != "-" ]]) && revdstport="--sport ${dstport}" - ([[ ${protocol} != "-" ]] && [[ ${protocol} != "" ]]) && protocol="-p ${protocol}" + [[ ${protocol} != "-" ]] && protocol="-p ${protocol}" ${debug} ${DebugColor} "${FUNCNAME}:${DEFAULT_COLOR}${action} ${srcinterface} ${srcaddress} ${dstinterface} ${dstaddress} ${bidirectional} ${srcport} ${dstport} ${protocol} ${syn}" @@ -401,6 +401,7 @@ function enable_forwarding { [[ ${dstport} == "-" ]] && dstport="" [[ ${srcport} == "-" ]] && srcport="" [[ ${syn} == "-" ]] && syn="" + [[ ${protocol} == "-" ]] && protocol="" [[ ${bidirectional} == "-" ]] && bidirectional="no" [[ ${action} == "DROP" ]] && conntrack_state=""