diff options
author | Darius <darius.joksas@teltonika.lt> | 2018-09-27 11:08:14 +0300 |
---|---|---|
committer | Jo-Philipp Wich <jo@mein.io> | 2018-09-29 13:55:53 +0200 |
commit | f0141773ac9f26f0d8b291006c6c1e01c29c0ef7 (patch) | |
tree | b31a4d8804fb1792df5eea64b58cf51b1afc82a3 /applications/luci-app-firewall | |
parent | a291a999a7d396adc1238bfbe4e0abbd870ba8f9 (diff) |
luci-app-firewall: remove unused code
- unused requirements removed
- unused variable and foreach loop removed
Signed-off-by: Darius <darius.joksas@teltonika.lt>
[slightly reword commit message]
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
Diffstat (limited to 'applications/luci-app-firewall')
-rw-r--r-- | applications/luci-app-firewall/luasrc/model/cbi/firewall/rule-details.lua | 27 |
1 files changed, 3 insertions, 24 deletions
diff --git a/applications/luci-app-firewall/luasrc/model/cbi/firewall/rule-details.lua b/applications/luci-app-firewall/luasrc/model/cbi/firewall/rule-details.lua index a4763d5dc..def01c669 100644 --- a/applications/luci-app-firewall/luasrc/model/cbi/firewall/rule-details.lua +++ b/applications/luci-app-firewall/luasrc/model/cbi/firewall/rule-details.lua @@ -1,15 +1,10 @@ -- Copyright 2008 Steven Barth <steven@midlink.org> -- Copyright 2010-2012 Jo-Philipp Wich <jow@openwrt.org> -- Licensed to the public under the Apache License 2.0. - -local sys = require "luci.sys" -local utl = require "luci.util" local dsp = require "luci.dispatcher" -local nxo = require "nixio" - local ft = require "luci.tools.firewall" local nw = require "luci.model.network" -local m, s, o, k, v +local m, s, o, v, _ arg[1] = arg[1] or "" @@ -46,22 +41,6 @@ elseif rule_type == "redirect" then m.title = "%s - %s" %{ translate("Firewall - Traffic Rules"), name } - 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 utl.imatch(n) 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 @@ -154,9 +133,9 @@ elseif rule_type == "redirect" then o.rmempty = false o.datatype = "ip4addr" - for k, v in ipairs(nw:get_interfaces()) do + for _, v in ipairs(nw:get_interfaces()) do local a - for k, a in ipairs(v:ipaddrs()) do + for _, a in ipairs(v:ipaddrs()) do o:value(a:host():string(), '%s (%s)' %{ a:host():string(), v:shortname() }) |