projects
/
project
/
luci.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
libs/core: Cleaned up luci.sys in favor of the new luci.ip module
[project/luci.git]
/
applications
/
luci-splash
/
root
/
usr
/
bin
/
luci-splashd
diff --git
a/applications/luci-splash/root/usr/bin/luci-splashd
b/applications/luci-splash/root/usr/bin/luci-splashd
index
a178ef2
..
e8c2752
100755
(executable)
--- a/
applications/luci-splash/root/usr/bin/luci-splashd
+++ b/
applications/luci-splash/root/usr/bin/luci-splashd
@@
-1,5
+1,7
@@
#!/usr/bin/lua
#!/usr/bin/lua
+
require("socket")
require("socket")
+require("luci.ip")
require("luci.model.uci")
luci.model.uci.set_savedir(luci.model.uci.savedir_state)
require("luci.model.uci")
luci.model.uci.set_savedir(luci.model.uci.savedir_state)
@@
-12,13
+14,13
@@
while true do
if client then
client:settimeout(1)
if client then
client:settimeout(1)
- local ip = client:getpeername()
local srv
local srv
+ local ip = luci.ip.IPv4(client:getpeername())
luci.model.uci.foreach("network", "interface",
function (section)
if section.ipaddr then
luci.model.uci.foreach("network", "interface",
function (section)
if section.ipaddr then
- local
p = luci.sys.net.mask4prefix(
section.netmask)
- if
luci.sys.net.belongs(ip, section.ipaddr,
p) then
+ local
net = luci.ip.IPv4(section.ipaddr,
section.netmask)
+ if
ip and net and net:contains(i
p) then
srv = section.ipaddr
return
end
srv = section.ipaddr
return
end