libs/core: return ordered list in luci.model.network.get_interfaces()

This commit is contained in:
Jo-Philipp Wich 2010-10-31 22:38:07 +00:00
parent 0364054107
commit 5b63f544f5

View file

@ -373,6 +373,7 @@ function get_interfaces(self)
local iface
local ifaces = { }
local seen = { }
local nfs = { }
-- find normal interfaces
uci_r:foreach("network", "interface",
@ -380,17 +381,21 @@ function get_interfaces(self)
for iface in utl.imatch(s.ifname) do
if not _iface_ignore(iface) and not _wifi_iface(iface) then
seen[iface] = true
ifaces[#ifaces+1] = interface(iface)
nfs[iface] = interface(iface)
end
end
end)
for iface in utl.kspairs(ifs) do
if not (seen[iface] or _iface_ignore(iface) or _wifi_iface(iface)) then
ifaces[#ifaces+1] = interface(iface)
nfs[iface] = interface(iface)
end
end
for iface in utl.kspairs(nfs) do
ifaces[#ifaces+1] = nfs[iface]
end
-- find wifi interfaces
local num = { }
local wfs = { }