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:
0f7d2d2
)
libs/core: network model fixes
author
Jo-Philipp Wich
<jow@openwrt.org>
Mon, 15 Nov 2010 22:03:45 +0000
(22:03 +0000)
committer
Jo-Philipp Wich
<jow@openwrt.org>
Mon, 15 Nov 2010 22:03:45 +0000
(22:03 +0000)
libs/core/luasrc/model/network.lua
patch
|
blob
|
history
diff --git
a/libs/core/luasrc/model/network.lua
b/libs/core/luasrc/model/network.lua
index 7882c81a85356c1c4a15e43ffc1e5b9ce29da958..cc4200cb48378c55383d5f63ccbe2d81e1775007 100644
(file)
--- a/
libs/core/luasrc/model/network.lua
+++ b/
libs/core/luasrc/model/network.lua
@@
-275,26
+275,14
@@
end
function del_network(self, n)
local r = uci_r:delete("network", n)
if r then
function del_network(self, n)
local r = uci_r:delete("network", n)
if r then
- uci_r:foreach("network", "alias",
- function(s)
- if s.interface == n then
- uci_r:delete("network", s['.name'])
- end
- end)
+ uci_r:delete_all("network", "alias",
+ function(s) return (s.interface == n) end)
- uci_r:foreach("network", "route",
- function(s)
- if s.interface == n then
- uci_r:delete("network", s['.name'])
- end
- end)
+ uci_r:delete_all("network", "route",
+ function(s) return (s.interface == n) end)
- uci_r:foreach("network", "route6",
- function(s)
- if s.interface == n then
- uci_r:delete("network", s['.name'])
- end
- end)
+ uci_r:delete_all("network", "route6",
+ function(s) return (s.interface == n) end)
uci_r:foreach("wireless", "wifi-iface",
function(s)
uci_r:foreach("wireless", "wifi-iface",
function(s)
@@
-302,8
+290,6
@@
function del_network(self, n)
uci_r:delete("wireless", s['.name'], "network")
end
end)
uci_r:delete("wireless", s['.name'], "network")
end
end)
-
- uci_r:delete("network", n)
end
return r
end
end
return r
end
@@
-990,7
+976,11
@@
function wifinet.name(self)
end
function wifinet.ifname(self)
end
function wifinet.ifname(self)
- return self.iwinfo.ifname or self.wdev
+ local ifname = self.iwinfo.ifname
+ if not ifname or ifname:match("^wifi%d") or ifname:match("^radio%d") then
+ ifname = self.wdev
+ end
+ return ifname
end
function wifinet.get_device(self)
end
function wifinet.get_device(self)