X-Git-Url: https://git.archive.openwrt.org/?p=project%2Fluci.git;a=blobdiff_plain;f=applications%2Fluci-firewall%2Fluasrc%2Fmodel%2Fcbi%2Ffirewall%2Fforwards.lua;h=5f7a69b255ec38f892d6bdd02ec00ea3fd9bf4e1;hp=660848cee6392b54deb955180a5a06aa427aa174;hb=e6915e72df00a2b699d368206ee94d5d15328a50;hpb=8a23de32d956f17e709cff400303f9c733197846 diff --git a/applications/luci-firewall/luasrc/model/cbi/firewall/forwards.lua b/applications/luci-firewall/luasrc/model/cbi/firewall/forwards.lua index 660848cee..5f7a69b25 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)