summaryrefslogtreecommitdiffhomepage
path: root/applications/luci-firewall/luasrc/model
diff options
context:
space:
mode:
authorJo-Philipp Wich <jow@openwrt.org>2012-09-11 18:35:40 +0000
committerJo-Philipp Wich <jow@openwrt.org>2012-09-11 18:35:40 +0000
commite6915e72df00a2b699d368206ee94d5d15328a50 (patch)
tree6b04bcd747d4ae054e23252306b0db88952284ca /applications/luci-firewall/luasrc/model
parent8a23de32d956f17e709cff400303f9c733197846 (diff)
applications/luci-firewall: offer zone selection in redirect quickadd (#483)
Diffstat (limited to 'applications/luci-firewall/luasrc/model')
-rw-r--r--applications/luci-firewall/luasrc/model/cbi/firewall/forwards.lua6
1 files changed, 4 insertions, 2 deletions
diff --git a/applications/luci-firewall/luasrc/model/cbi/firewall/forwards.lua b/applications/luci-firewall/luasrc/model/cbi/firewall/forwards.lua
index 660848cee6..5f7a69b255 100644
--- a/applications/luci-firewall/luasrc/model/cbi/firewall/forwards.lua
+++ b/applications/luci-firewall/luasrc/model/cbi/firewall/forwards.lua
@@ -35,7 +35,9 @@ s.template_addremove = "firewall/cbi_addforward"
function s.create(self, section)
local n = m:formvalue("_newfwd.name")
local p = m:formvalue("_newfwd.proto")
+ local E = m:formvalue("_newfwd.extzone")
local e = m:formvalue("_newfwd.extport")
+ local I = m:formvalue("_newfwd.intzone")
local a = m:formvalue("_newfwd.intaddr")
local i = m:formvalue("_newfwd.intport")
@@ -43,8 +45,8 @@ function s.create(self, section)
created = TypedSection.create(self, section)
self.map:set(created, "target", "DNAT")
- self.map:set(created, "src", "wan")
- self.map:set(created, "dest", "lan")
+ self.map:set(created, "src", E or "wan")
+ self.map:set(created, "dest", I or "lan")
self.map:set(created, "proto", (p ~= "other") and p or "all")
self.map:set(created, "src_dport", e)
self.map:set(created, "dest_ip", a)