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>
This commit is contained in:
Darius 2018-09-27 11:08:14 +03:00 committed by Jo-Philipp Wich
parent a291a999a7
commit f0141773ac

View file

@ -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()
})