summaryrefslogtreecommitdiffhomepage
path: root/applications/luci-app-shadowsocks-libev/luasrc/model
diff options
context:
space:
mode:
authorJo-Philipp Wich <jo@mein.io>2017-07-10 16:16:35 +0200
committerJo-Philipp Wich <jo@mein.io>2017-07-11 14:05:31 +0200
commit854a5f68bb277ce3b4f47f416c9569eec66254d2 (patch)
treefef6e364890ae9febe7cf008a3d8ff7da5d4581d /applications/luci-app-shadowsocks-libev/luasrc/model
parentb2154e0b632d28ba949092a19f95d5d8804e9a94 (diff)
luci-app-shadowsocks-libev: eliminate use of luci.sys.net.arptable()
Translate the use of luci.sys.net.arptable() to luci.ip.neighbors() to allow dropping the former function from base LuCI later on. Signed-off-by: Jo-Philipp Wich <jo@mein.io>
Diffstat (limited to 'applications/luci-app-shadowsocks-libev/luasrc/model')
-rw-r--r--applications/luci-app-shadowsocks-libev/luasrc/model/cbi/shadowsocks-libev.lua11
1 files changed, 6 insertions, 5 deletions
diff --git a/applications/luci-app-shadowsocks-libev/luasrc/model/cbi/shadowsocks-libev.lua b/applications/luci-app-shadowsocks-libev/luasrc/model/cbi/shadowsocks-libev.lua
index 76435e2f14..97ce83f771 100644
--- a/applications/luci-app-shadowsocks-libev/luasrc/model/cbi/shadowsocks-libev.lua
+++ b/applications/luci-app-shadowsocks-libev/luasrc/model/cbi/shadowsocks-libev.lua
@@ -137,13 +137,14 @@ o:value("2", translate("Allow all except listed"))
o.default = 0
o.rmempty = false
-a = luci.sys.net.arptable() or {}
-
o = s:taboption("lan_ac", DynamicList, "lan_ac_ip", translate("LAN IP List"))
o.datatype = "ipaddr"
-for i,v in ipairs(a) do
- o:value(v["IP address"])
-end
+
+luci.ip.neighbors({ family = 4 }, function(entry)
+ if entry.reachable then
+ o:value(entry.dest:string())
+ end
+end)
s:tab("wan_ac", translate("WAN"))