summaryrefslogtreecommitdiffhomepage
path: root/libs/core/luasrc
diff options
context:
space:
mode:
authorJo-Philipp Wich <jow@openwrt.org>2011-09-24 03:31:00 +0000
committerJo-Philipp Wich <jow@openwrt.org>2011-09-24 03:31:00 +0000
commit47f011b947f3416c64f2352ca988de6004f49e5f (patch)
tree7ad8229f5f38582b32508a835aa8fee74d422d95 /libs/core/luasrc
parent3311da13e79247581e60a2043400017de15b5bb6 (diff)
libs/core: non-bridge handling fix in network model
Diffstat (limited to 'libs/core/luasrc')
-rw-r--r--libs/core/luasrc/model/network.lua33
1 files changed, 15 insertions, 18 deletions
diff --git a/libs/core/luasrc/model/network.lua b/libs/core/luasrc/model/network.lua
index 26344c2cc..983483d82 100644
--- a/libs/core/luasrc/model/network.lua
+++ b/libs/core/luasrc/model/network.lua
@@ -791,26 +791,23 @@ function network.get_interfaces(self)
ifaces[#ifaces+1] = nfs[ifn]
end
- local num = { }
- local wfs = { }
- uci_r:foreach("wireless", "wifi-iface",
- function(s)
- if s.device then
- num[s.device] = num[s.device] and num[s.device] + 1 or 1
- if s.network == self.sid then
- ifn = "%s.network%d" %{ s.device, num[s.device] }
- wfs[ifn] = interface(ifn, self)
+ if self:is_bridge() then
+ local num = { }
+ local wfs = { }
+ uci_r:foreach("wireless", "wifi-iface",
+ function(s)
+ if s.device then
+ num[s.device] = num[s.device] and num[s.device] + 1 or 1
+ if s.network == self.sid then
+ ifn = "%s.network%d" %{ s.device, num[s.device] }
+ wfs[ifn] = interface(ifn, self)
+ end
end
- end
- end)
-
- for ifn in utl.kspairs(wfs) do
- ifaces[#ifaces+1] = wfs[ifn]
+ end)
- -- only bridges may cover more than one interface
- --if not self:is_bridge() then
- -- break
- --end
+ for ifn in utl.kspairs(wfs) do
+ ifaces[#ifaces+1] = wfs[ifn]
+ end
end
return ifaces