projects
/
project
/
luci.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
29f0b48
)
libs/core: fix luci.model.firewall.rename_zone()
author
Jo-Philipp Wich
<jow@openwrt.org>
Sat, 30 Oct 2010 18:26:46 +0000
(18:26 +0000)
committer
Jo-Philipp Wich
<jow@openwrt.org>
Sat, 30 Oct 2010 18:26:46 +0000
(18:26 +0000)
libs/core/luasrc/model/firewall.lua
patch
|
blob
|
history
diff --git
a/libs/core/luasrc/model/firewall.lua
b/libs/core/luasrc/model/firewall.lua
index 713fc57048a373bc699977613dd54f6e82995107..c13f5d6a1bbc4ac94c2d2dd5d2fdeaae4f8477ed 100644
(file)
--- 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 _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
uci_r:set("firewall", s['.name'], "name", new)
r = true
return false
@@
-209,10
+212,10
@@
function rename_zone(self, old, new)
end
end)
end
end)
- u
b.uci
:foreach("firewall", "forwarding",
+ u
ci_r
:foreach("firewall", "forwarding",
function(s)
if s.src == old then
function(s)
if s.src == old then
- u
b.uci
:set("firewall", s['.name'], "src", new)
+ u
ci_r
:set("firewall", s['.name'], "src", new)
end
if s.dest == old then
uci_r:set("firewall", s['.name'], "dest", new)
end
if s.dest == old then
uci_r:set("firewall", s['.name'], "dest", new)