libs/core: fix firewall model

This commit is contained in:
Jo-Philipp Wich 2009-10-10 04:48:57 +00:00
parent 03a6d3fcd4
commit 0533309ef2

View file

@ -74,21 +74,21 @@ function get_zones(self)
return zones
end
function get_zones_by_network(self, net)
local zones = { }
function get_zone_by_network(self, net)
local z
ub.uci:foreach("firewall", "zone",
function(s)
if s.name then
if s.name and net then
local n
for _, n in ipairs(ub:list(s.network or s.name)) do
if n == net then
zones[#zones+1] = zone(s['.name'])
return true
z = s['.name']
return false
end
end
end
end)
return zones
return z and zone(z)
end
function del_zone(self, n)