firewall: also set up nat reflection rules for redirects with proto all and/or no src_dport set

SVN-Revision: 32652
This commit is contained in:
Jo-Philipp Wich 2012-07-09 12:23:36 +00:00
parent 86de034767
commit 4127e73b84
2 changed files with 3 additions and 2 deletions

View file

@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
PKG_NAME:=firewall PKG_NAME:=firewall
PKG_VERSION:=2 PKG_VERSION:=2
PKG_RELEASE:=52 PKG_RELEASE:=53
include $(INCLUDE_DIR)/package.mk include $(INCLUDE_DIR)/package.mk

View file

@ -69,7 +69,7 @@ if [ "$ACTION" = "add" ] && [ "$INTERFACE" = "wan" ]; then
config_get proto "$cfg" proto config_get proto "$cfg" proto
local epmin epmax extport local epmin epmax extport
config_get extport "$cfg" src_dport config_get extport "$cfg" src_dport "1-65535"
[ -n "$extport" ] || return [ -n "$extport" ] || return
epmin="${extport%[-:]*}"; epmax="${extport#*[-:]}" epmin="${extport%[-:]*}"; epmax="${extport#*[-:]}"
@ -88,6 +88,7 @@ if [ "$ACTION" = "add" ] && [ "$INTERFACE" = "wan" ]; then
config_get inthost "$cfg" dest_ip config_get inthost "$cfg" dest_ip
[ -n "$inthost" ] || return [ -n "$inthost" ] || return
[ "$proto" = all ] && proto="tcp udp"
[ "$proto" = tcpudp ] && proto="tcp udp" [ "$proto" = tcpudp ] && proto="tcp udp"
[ "${inthost#!}" = "$inthost" ] || return 0 [ "${inthost#!}" = "$inthost" ] || return 0