git.99rst.org
/
openwrt-luci.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
| inline |
side by side
(parent:
e96429a
)
applications/luci-splash: properly fix mac address detection in mixed IPv4/IPv6 envir...
author
Jo-Philipp Wich
<redacted>
Sat, 30 May 2009 22:38:46 +0000
(22:38 +0000)
committer
Jo-Philipp Wich
<redacted>
Sat, 30 May 2009 22:38:46 +0000
(22:38 +0000)
applications/luci-splash/luasrc/controller/splash/splash.lua
patch
|
blob
|
history
diff --git
a/applications/luci-splash/luasrc/controller/splash/splash.lua
b/applications/luci-splash/luasrc/controller/splash/splash.lua
index 5731efc8ca5b6aed2767f09fb2a483cb3b20762a..8603b141fab5979c973c20710767e2f116afa8e0 100644
(file)
--- a/
applications/luci-splash/luasrc/controller/splash/splash.lua
+++ b/
applications/luci-splash/luasrc/controller/splash/splash.lua
@@
-19,7
+19,8
@@
function action_dispatch()
end
function action_activate()
- local mac = luci.sys.net.ip4mac(luci.http.getenv("REMOTE_ADDR"))
+ local ip = luci.http.getenv("REMOTE_ADDR") or "127.0.0.1"
+ local mac = luci.sys.net.ip4mac(ip:match("^[\[::ffff:]*(%d+.%d+%.%d+%.%d+)\]*$"))
if mac and luci.http.formvalue("accept") then
os.execute("luci-splash add "..mac.." >/dev/null 2>&1")
luci.http.redirect(luci.model.uci.cursor():get("freifunk", "community", "homepage"))
git clone https://git.99rst.org/PROJECT