diff options
author | Yousong Zhou <yszhou4tech@gmail.com> | 2017-08-22 10:48:51 +0800 |
---|---|---|
committer | Yousong Zhou <yszhou4tech@gmail.com> | 2017-08-22 20:19:50 +0800 |
commit | 4b042bcbd9104c128dd2255b02f8dbc2dd59b653 (patch) | |
tree | 6bb2ca90191b84668d399aca35ca6a63246e19fe /applications/luci-app-shadowsocks-libev/luasrc/model/shadowsocks-libev.lua | |
parent | f5fa1a0f0834d6b3fd3d920d6aebde149bb7a0f0 (diff) |
luci-app-shadowsocks-libev: enumerate ifnames with sys.net.devices()
Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com>
Diffstat (limited to 'applications/luci-app-shadowsocks-libev/luasrc/model/shadowsocks-libev.lua')
-rw-r--r-- | applications/luci-app-shadowsocks-libev/luasrc/model/shadowsocks-libev.lua | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/applications/luci-app-shadowsocks-libev/luasrc/model/shadowsocks-libev.lua b/applications/luci-app-shadowsocks-libev/luasrc/model/shadowsocks-libev.lua index e2a07adae1..7ba6b40c53 100644 --- a/applications/luci-app-shadowsocks-libev/luasrc/model/shadowsocks-libev.lua +++ b/applications/luci-app-shadowsocks-libev/luasrc/model/shadowsocks-libev.lua @@ -3,6 +3,7 @@ local _up = getfenv(3) local ut = require("luci.util") +local sys = require("luci.sys") local ds = require("luci.dispatcher") local nw = require("luci.model.network") nw.init() @@ -56,10 +57,8 @@ function values_ipaddr(o) end function values_ifnames(o) - for _, v in ipairs(nw:get_interfaces()) do - if v.dev then - o:value(v.dev.name) - end + for _, v in ipairs(sys.net.devices()) do + o:value(v) end end |