luci-base: let luci.sys.net.devices() return all netdevs
The previous implementation of the function only returned ethernet interfaces because it relied on the AF_PACKET family entries returned by getifaddrs(). Change the function to simply collect all interface names it sees in order to avoid missing tunnel interfaces. Fixes FS#917. Signed-off-by: Jo-Philipp Wich <jo@mein.io>
This commit is contained in:
parent
3630387a94
commit
4201282559
1 changed files with 3 additions and 1 deletions
|
@ -348,8 +348,10 @@ end
|
|||
|
||||
function net.devices()
|
||||
local devs = {}
|
||||
local seen = {}
|
||||
for k, v in ipairs(nixio.getifaddrs()) do
|
||||
if v.family == "packet" then
|
||||
if v.name and not seen[v.name] then
|
||||
seen[v.name] = true
|
||||
devs[#devs+1] = v.name
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue