libs/core: fix multiple errors in zone delete handling of firewall model
This commit is contained in:
parent
3faeaddc5e
commit
1a221ddfb9
1 changed files with 3 additions and 3 deletions
|
@ -154,7 +154,7 @@ function del_zone(self, n)
|
||||||
|
|
||||||
if uci_r:get("firewall", n) == "zone" then
|
if uci_r:get("firewall", n) == "zone" then
|
||||||
local z = uci_r:get("firewall", n, "name")
|
local z = uci_r:get("firewall", n, "name")
|
||||||
r = uci_r:delete("firwall", n)
|
r = uci_r:delete("firewall", n)
|
||||||
n = z
|
n = z
|
||||||
else
|
else
|
||||||
uci_r:foreach("firewall", "zone",
|
uci_r:foreach("firewall", "zone",
|
||||||
|
@ -176,14 +176,14 @@ function del_zone(self, n)
|
||||||
|
|
||||||
uci_r:foreach("firewall", "redirect",
|
uci_r:foreach("firewall", "redirect",
|
||||||
function(s)
|
function(s)
|
||||||
if s.src == n then
|
if s.src == n or s.dest == n then
|
||||||
uci_r:delete("firewall", s['.name'])
|
uci_r:delete("firewall", s['.name'])
|
||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
|
|
||||||
uci_r:foreach("firewall", "forwarding",
|
uci_r:foreach("firewall", "forwarding",
|
||||||
function(s)
|
function(s)
|
||||||
if s.src == n then
|
if s.src == n or s.dest == n then
|
||||||
uci_r:delete("firewall", s['.name'])
|
uci_r:delete("firewall", s['.name'])
|
||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
|
|
Loading…
Reference in a new issue