Make multiport work with iptables 1.2.7

git-svn-id: https://shorewall.svn.sourceforge.net/svnroot/shorewall/trunk@197 fbd18981-670d-0410-9b5c-8dc0c1a9a2bb
This commit is contained in:
teastep 2002-08-14 16:01:32 +00:00
parent d501ed19ef
commit 6ae0ea8981

View File

@ -1565,7 +1565,13 @@ add_nat_rule() {
# Replace destination port by the new destination port # Replace destination port by the new destination port
[ -n "$servport" ] && dports="--dport ${servport#*:}" if [ -n "$servport" ]; then
if [ -z "$multiport" ]; then
dports="--dport ${servport#*:}"
else
dports="--dports ${servport#*:}"
fi
fi
# Handle SNAT # Handle SNAT
@ -1650,18 +1656,29 @@ add_a_rule()
case $proto in case $proto in
tcp|udp|TCP|UDP|6|17) tcp|udp|TCP|UDP|6|17)
if [ -n "$port" -a "x${port}" != "x-" ]; then if [ -n "$port" -a "x${port}" != "x-" ]; then
[ -n "$multioption" ] && \ if [ -n "$multioption" ]; then
[ "$port" != "${port%,*}" ] && \ if [ "$port" != "${port%,*}" ]; then
multiport="$multioption" multiport="$multioption"
dports="--dport $port" dports="--dports $port"
else
dports="--dport $port"
fi
else
dports="--dport $port"
fi
fi fi
if [ -n "$cport" -a "x${cport}" != "x-" ]; then if [ -n "$cport" -a "x${cport}" != "x-" ]; then
[ -n "$multioption" ] && \ if [ -n "$multioption" ]; then
[ -z "$multiport" ] && \ if [ "$cport" != "${cport%,*}" ]; then
[ "$cport" != "${cport%,*}" ] && \ multiport="$multioption"
multiport="$multioption" sports="--sports $cport"
sports="--sport $cport" else
sports="--sport $cport"
fi
else
sports="--sport $cport"
fi
fi fi
;; ;;
icmp|ICMP|1) icmp|ICMP|1)