applications/luci-firewall: remove nat reflection dependency on the wan zone, it...
[project/luci.git] / applications / luci-firewall / luasrc / model / cbi / firewall / forward-details.lua
index 162767f..c80a6d0 100644 (file)
@@ -39,22 +39,6 @@ else
        m.title = "%s - %s" %{ translate("Firewall - Port Forwards"), name }
 end
 
-local wan_zone = nil
-
-m.uci:foreach("firewall", "zone",
-       function(s)
-               local n = s.network or s.name
-               if n then
-                       local i
-                       for i in n:gmatch("%S+") do
-                               if i == "wan" then
-                                       wan_zone = s.name
-                                       return false
-                               end
-                       end
-               end
-       end)
-
 s = m:section(NamedSection, arg[1], "redirect", "")
 s.anonymous = true
 s.addremove = false
@@ -88,7 +72,7 @@ o = s:option(DynamicList, "src_mac",
        translate("Source MAC address"),
        translate("Only match incoming traffic from these MACs."))
 o.rmempty = true
-o.datatype = "macaddr"
+o.datatype = "neg(macaddr)"
 o.placeholder = translate("any")
 
 luci.sys.net.mac_hints(function(mac, name)
@@ -112,7 +96,7 @@ o = s:option(Value, "src_port",
        translate("Source port"),
        translate("Only match incoming traffic originating from the given source port or port range on the client host"))
 o.rmempty = true
-o.datatype = "portrange"
+o.datatype = "neg(portrange)"
 o.placeholder = translate("any")
 
 
@@ -126,14 +110,14 @@ end)
 
 
 o.rmempty = true
-o.datatype = "ip4addr"
+o.datatype = "neg(ip4addr)"
 o.placeholder = translate("any")
 
 
 o = s:option(Value, "src_dport", translate("External port"),
        translate("Match incoming traffic directed at the given " ..
                "destination port or port range on this host"))
-o.datatype = "portrange"
+o.datatype = "neg(portrange)"
 
 
 
@@ -164,7 +148,6 @@ o.datatype = "portrange"
 o = s:option(Flag, "reflection", translate("Enable NAT Loopback"))
 o.rmempty = true
 o.default = o.enabled
-o:depends("src", wan_zone)
 o.cfgvalue = function(...)
        return Flag.cfgvalue(...) or "1"
 end