libs/core: return ordered list in luci.model.network.get_interfaces()
This commit is contained in:
parent
0364054107
commit
5b63f544f5
1 changed files with 7 additions and 2 deletions
|
@ -373,6 +373,7 @@ function get_interfaces(self)
|
||||||
local iface
|
local iface
|
||||||
local ifaces = { }
|
local ifaces = { }
|
||||||
local seen = { }
|
local seen = { }
|
||||||
|
local nfs = { }
|
||||||
|
|
||||||
-- find normal interfaces
|
-- find normal interfaces
|
||||||
uci_r:foreach("network", "interface",
|
uci_r:foreach("network", "interface",
|
||||||
|
@ -380,17 +381,21 @@ function get_interfaces(self)
|
||||||
for iface in utl.imatch(s.ifname) do
|
for iface in utl.imatch(s.ifname) do
|
||||||
if not _iface_ignore(iface) and not _wifi_iface(iface) then
|
if not _iface_ignore(iface) and not _wifi_iface(iface) then
|
||||||
seen[iface] = true
|
seen[iface] = true
|
||||||
ifaces[#ifaces+1] = interface(iface)
|
nfs[iface] = interface(iface)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
|
|
||||||
for iface in utl.kspairs(ifs) do
|
for iface in utl.kspairs(ifs) do
|
||||||
if not (seen[iface] or _iface_ignore(iface) or _wifi_iface(iface)) then
|
if not (seen[iface] or _iface_ignore(iface) or _wifi_iface(iface)) then
|
||||||
ifaces[#ifaces+1] = interface(iface)
|
nfs[iface] = interface(iface)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
for iface in utl.kspairs(nfs) do
|
||||||
|
ifaces[#ifaces+1] = nfs[iface]
|
||||||
|
end
|
||||||
|
|
||||||
-- find wifi interfaces
|
-- find wifi interfaces
|
||||||
local num = { }
|
local num = { }
|
||||||
local wfs = { }
|
local wfs = { }
|
||||||
|
|
Loading…
Reference in a new issue