summaryrefslogtreecommitdiffhomepage
path: root/libs
diff options
context:
space:
mode:
authorJo-Philipp Wich <jow@openwrt.org>2010-10-31 22:38:07 +0000
committerJo-Philipp Wich <jow@openwrt.org>2010-10-31 22:38:07 +0000
commit5b63f544f520a6d441713940a017a312f1e5e32d (patch)
treed38f6d329edba60598883021a03f79e5468520fc /libs
parent0364054107f1b60453c421dd2613be6edb903621 (diff)
libs/core: return ordered list in luci.model.network.get_interfaces()
Diffstat (limited to 'libs')
-rw-r--r--libs/core/luasrc/model/network.lua9
1 files changed, 7 insertions, 2 deletions
diff --git a/libs/core/luasrc/model/network.lua b/libs/core/luasrc/model/network.lua
index 54008b54b..7ef31b862 100644
--- a/libs/core/luasrc/model/network.lua
+++ b/libs/core/luasrc/model/network.lua
@@ -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 = { }