Fix syntax error in setup_nat()

git-svn-id: https://shorewall.svn.sourceforge.net/svnroot/shorewall/trunk@1486 fbd18981-670d-0410-9b5c-8dc0c1a9a2bb
This commit is contained in:
teastep 2004-07-19 13:50:14 +00:00
parent 15eb297ff9
commit 0ca314fa36
3 changed files with 44 additions and 2 deletions

View File

@ -27,3 +27,7 @@ Changes since 2.0.3
nat nat
firewall firewall
9) Fix syntax error in setup_nat()
firewall

View File

@ -1876,7 +1876,7 @@ delete_proxy_arp() {
# Setup Static Network Address Translation (NAT) # Setup Static Network Address Translation (NAT)
# #
setup_nat() { setup_nat() {
local external, interface, internal, allints, localnat local external= interface= internal= allints= localnat=
do_one_nat() { do_one_nat() {
local add_ip_aliases=$ADD_IP_ALIASES, iface=${interface%:*} local add_ip_aliases=$ADD_IP_ALIASES, iface=${interface%:*}
@ -2781,9 +2781,47 @@ process_action() # $1 = action
createactionchain() # $1 = chain name createactionchain() # $1 = chain name
{ {
createchain $1 no createchain $1 no
CHAIN=$1
run_user_exit $CHAIN
}
createlogactionchain() # $1 = Action Name, $2 = Log Level
{
local actchain=
eval actchain=\$${1}_actchain
[ -n "$actchain" ] || actchain=1
CHAIN=${1}${actchain}
eval ${1}_actchain=$(($actchain + 1))
createchain $CHAIN
run_user_exit $1 run_user_exit $1
} }
find_logactionchain() # $1 = Action Name, $2 = Log Level
{
local action=$1 level=$2 chains=
eval chains="\$${action}_chains"
set -- $chains
while [ $# -gt 0 ]; do
[ "$1" = "$level" ] && { echo $2 ; return ; }
shift;shift
done
createlogactionchain $action $level
echo $CHAIN
eval ${action}_chains=\"\$${action}_chains $level $CHAIN\"
}
# #
# Read /etc/shorewall/actions and for each defined <action>, pre-process # Read /etc/shorewall/actions and for each defined <action>, pre-process
# /etc/shorewall/action.<action> # /etc/shorewall/action.<action>