summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorJo-Philipp Wich <jow@openwrt.org>2011-09-25 11:58:24 +0000
committerJo-Philipp Wich <jow@openwrt.org>2011-09-25 11:58:24 +0000
commita6dcb3f6a3af704b6331e2fe789e57f692bf9c7f (patch)
tree6610b3fff8e57f5d257198a57bac0f15e41526c1
parentdc46ee35b85bd6dbda23593ee21bd4489041880c (diff)
libs/core: more fixes in network model
-rw-r--r--libs/core/luasrc/model/network.lua26
1 files changed, 13 insertions, 13 deletions
diff --git a/libs/core/luasrc/model/network.lua b/libs/core/luasrc/model/network.lua
index 983483d82d..5e7d7d6b6f 100644
--- a/libs/core/luasrc/model/network.lua
+++ b/libs/core/luasrc/model/network.lua
@@ -778,20 +778,20 @@ function network.get_interface(self)
end
function network.get_interfaces(self)
- local ifaces = { }
+ if self:is_bridge() or (self:is_virtual() and not self:is_floating()) then
+ local ifaces = { }
- local ifn
- local nfs = { }
- for ifn in utl.imatch(self:get("ifname")) do
- ifn = ifn:match("^[^:/]+")
- nfs[ifn] = interface(ifn, self)
- end
+ local ifn
+ local nfs = { }
+ for ifn in utl.imatch(self:get("ifname")) do
+ ifn = ifn:match("^[^:/]+")
+ nfs[ifn] = interface(ifn, self)
+ end
- for ifn in utl.kspairs(nfs) do
- ifaces[#ifaces+1] = nfs[ifn]
- end
+ for ifn in utl.kspairs(nfs) do
+ ifaces[#ifaces+1] = nfs[ifn]
+ end
- if self:is_bridge() then
local num = { }
local wfs = { }
uci_r:foreach("wireless", "wifi-iface",
@@ -808,9 +808,9 @@ function network.get_interfaces(self)
for ifn in utl.kspairs(wfs) do
ifaces[#ifaces+1] = wfs[ifn]
end
- end
- return ifaces
+ return ifaces
+ end
end
function network.contains_interface(self, ifname)