X-Git-Url: http://git.archive.openwrt.org/?p=project%2Fluci.git;a=blobdiff_plain;f=libs%2Fcore%2Fluasrc%2Fmodel%2Ffirewall.lua;h=a9f6fdb7fc2c4b87d39657b6cd85bb17b89457d3;hp=c4904eba8edadc93422a03f42f50d2c9d5ad199d;hb=bbb44cf245c11bc0c1d59e836007c9e8c3bfa209;hpb=75ccb1c5a89f23f6f6c99f9bcc77272e86dc2097 diff --git a/libs/core/luasrc/model/firewall.lua b/libs/core/luasrc/model/firewall.lua index c4904eba8..a9f6fdb7f 100644 --- a/libs/core/luasrc/model/firewall.lua +++ b/libs/core/luasrc/model/firewall.lua @@ -20,7 +20,7 @@ limitations under the License. local type, pairs, ipairs, table, luci, math = type, pairs, ipairs, table, luci, math -local lmo = require "lmo" +local tpl = require "luci.template.parser" local utl = require "luci.util" local uci = require "luci.model.uci" @@ -154,7 +154,7 @@ function del_zone(self, n) if uci_r:get("firewall", n) == "zone" then local z = uci_r:get("firewall", n, "name") - r = uci_r:delete("firwall", n) + r = uci_r:delete("firewall", n) n = z else uci_r:foreach("firewall", "zone", @@ -176,14 +176,14 @@ function del_zone(self, n) uci_r:foreach("firewall", "redirect", function(s) - if s.src == n then + if s.src == n or s.dest == n then uci_r:delete("firewall", s['.name']) end end) uci_r:foreach("firewall", "forwarding", function(s) - if s.src == n then + if s.src == n or s.dest == n then uci_r:delete("firewall", s['.name']) end end) @@ -478,7 +478,7 @@ function zone.get_color(self) elseif self and self:name() == "wan" then return "#f09090" elseif self then - math.randomseed(lmo.hash(self:name())) + math.randomseed(tpl.hash(self:name())) local r = math.random(128) local g = math.random(128)