libs/core: more fixes in network model

This commit is contained in:
Jo-Philipp Wich 2011-09-25 11:58:24 +00:00
parent dc46ee35b8
commit a6dcb3f6a3

View file

@ -778,6 +778,7 @@ function network.get_interface(self)
end end
function network.get_interfaces(self) function network.get_interfaces(self)
if self:is_bridge() or (self:is_virtual() and not self:is_floating()) then
local ifaces = { } local ifaces = { }
local ifn local ifn
@ -791,7 +792,6 @@ function network.get_interfaces(self)
ifaces[#ifaces+1] = nfs[ifn] ifaces[#ifaces+1] = nfs[ifn]
end end
if self:is_bridge() then
local num = { } local num = { }
local wfs = { } local wfs = { }
uci_r:foreach("wireless", "wifi-iface", uci_r:foreach("wireless", "wifi-iface",
@ -808,9 +808,9 @@ function network.get_interfaces(self)
for ifn in utl.kspairs(wfs) do for ifn in utl.kspairs(wfs) do
ifaces[#ifaces+1] = wfs[ifn] ifaces[#ifaces+1] = wfs[ifn]
end end
end
return ifaces return ifaces
end
end end
function network.contains_interface(self, ifname) function network.contains_interface(self, ifname)