diff options
author | Jo-Philipp Wich <jow@openwrt.org> | 2010-10-30 18:26:46 +0000 |
---|---|---|
committer | Jo-Philipp Wich <jow@openwrt.org> | 2010-10-30 18:26:46 +0000 |
commit | 141095fa7ff67dbe49bc0c775895fb276dfaf976 (patch) | |
tree | 9671e5d86425b2d333e8711bb06e1b14bd8a7b67 | |
parent | 29f0b48ddc46564e6d9bf3e64c763128e0235b10 (diff) |
libs/core: fix luci.model.firewall.rename_zone()
-rw-r--r-- | libs/core/luasrc/model/firewall.lua | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/libs/core/luasrc/model/firewall.lua b/libs/core/luasrc/model/firewall.lua index 713fc57048..c13f5d6a1b 100644 --- a/libs/core/luasrc/model/firewall.lua +++ b/libs/core/luasrc/model/firewall.lua @@ -181,7 +181,10 @@ function rename_zone(self, old, new) if _valid_id(new) and not self:get_zone(new) then uci_r:foreach("firewall", "zone", function(s) - if n and s.name == old then + if old and s.name == old then + if not s.network then + uci_r:set("firewall", s['.name'], "network", old) + end uci_r:set("firewall", s['.name'], "name", new) r = true return false @@ -209,10 +212,10 @@ function rename_zone(self, old, new) end end) - ub.uci:foreach("firewall", "forwarding", + uci_r:foreach("firewall", "forwarding", function(s) if s.src == old then - ub.uci:set("firewall", s['.name'], "src", new) + uci_r:set("firewall", s['.name'], "src", new) end if s.dest == old then uci_r:set("firewall", s['.name'], "dest", new) |