use proto instead of protocol in uci firewall

SVN-Revision: 12391
This commit is contained in:
John Crispin 2008-08-26 07:23:29 +00:00
parent a4ad20d76b
commit aa6c019c11
2 changed files with 6 additions and 6 deletions

View file

@ -50,7 +50,7 @@ config forwarding
# option dest lan # option dest lan
# option dest_ip 192.168.16.235 # option dest_ip 192.168.16.235
# option dest_port 80 # option dest_port 80
# option protocol tcp # option proto tcp
# include a file with users custom iptables rules # include a file with users custom iptables rules
#config include #config include

View file

@ -211,7 +211,7 @@ fw_redirect() {
local src_mac local src_mac
local dest_ip local dest_ip
local dest_port local dest_port
local protocol local proto
config_get src $1 src config_get src $1 src
config_get src_ip $1 src_ip config_get src_ip $1 src_ip
@ -220,20 +220,20 @@ fw_redirect() {
config_get src_mac $1 src_mac config_get src_mac $1 src_mac
config_get dest_ip $1 dest_ip config_get dest_ip $1 dest_ip
config_get dest_port $1 dest_port config_get dest_port $1 dest_port
config_get protocol $1 protocol config_get proto $1 proto
[ -z "$src" -o -z "$dest_ip" ] && { \ [ -z "$src" -o -z "$dest_ip" ] && { \
echo "redirect needs src and dest_ip"; return ; } echo "redirect needs src and dest_ip"; return ; }
[ -n "$dest_port" -a -z "$protocol" ] && { \ [ -n "$dest_port" -a -z "$proto" ] && { \
echo "dport may only be used it proto is defined"; return; } echo "dport may only be used it proto is defined"; return; }
$IPTABLES -A zone_${src}_prerouting -t nat \ $IPTABLES -A zone_${src}_prerouting -t nat \
${protocol:+-p $protocol} \ ${proto:+-p $proto} \
${src_ip:+-s $src_ip} \ ${src_ip:+-s $src_ip} \
${src_port:+--sport $src_port} \ ${src_port:+--sport $src_port} \
${src_dport:+--dport $src_dport} \ ${src_dport:+--dport $src_dport} \
${src_mac:+-m mac --mac-source $src_mac} \ ${src_mac:+-m mac --mac-source $src_mac} \
-j DNAT --to-destination $dest_ip${dest_port:+:$dest_port} -j DNAT --to-destination $dest_ip${dest_port:+:$dest_port}
$IPTABLES -I zone_${src}_forward 1 \ $IPTABLES -I zone_${src}_forward 1 \
${protocol:+-p $protocol} \ ${proto:+-p $proto} \
-d $dest_ip \ -d $dest_ip \
${src_ip:+-s $src_ip} \ ${src_ip:+-s $src_ip} \
${src_port:+--sport $src_port} \ ${src_port:+--sport $src_port} \