diff options
Diffstat (limited to 'applications')
-rw-r--r-- | applications/luci-app-olsr-services/luasrc/view/freifunk-services/services.htm | 8 | ||||
-rwxr-xr-x | applications/luci-app-splash/root/usr/sbin/luci-splash | 13 |
2 files changed, 14 insertions, 7 deletions
diff --git a/applications/luci-app-olsr-services/luasrc/view/freifunk-services/services.htm b/applications/luci-app-olsr-services/luasrc/view/freifunk-services/services.htm index 7142c77b39..0e59c61258 100644 --- a/applications/luci-app-olsr-services/luasrc/view/freifunk-services/services.htm +++ b/applications/luci-app-olsr-services/luasrc/view/freifunk-services/services.htm @@ -93,9 +93,9 @@ if luci.http.formvalue("status") == "1" then local rv = {} for k, line in ipairs(services) do local field = utl.split(line, "[#|]", split, true) - local origin_lnk = ip.IPv6(pcdata(field[4])) or "" + local origin_lnk = ip.IPv6(pcdata(field[4])) local origin_link = "" - if #origin_lnk ~= 0 and origin_lnk:is6() then + if origin_lnk and origin_lnk:is6() then origin_link = "["..origin_lnk:string().."]" else origin_link = pcdata(field[4]) @@ -168,9 +168,9 @@ end local field = {} -- split line at # and |, 1=url, 2=proto, 3=description, 4=source local field = utl.split(line, "[#|]", split, true) - local origin_lnk = ip.IPv6(pcdata(field[4])) or "" + local origin_lnk = ip.IPv6(pcdata(field[4])) local origin_link - if #origin_lnk ~= 0 and origin_lnk:is6() then + if origin_lnk and origin_lnk:is6() then origin_link = "["..origin_lnk:string().."]" else origin_link = pcdata(field[4]) diff --git a/applications/luci-app-splash/root/usr/sbin/luci-splash b/applications/luci-app-splash/root/usr/sbin/luci-splash index e566e9b508..2870dbe6aa 100755 --- a/applications/luci-app-splash/root/usr/sbin/luci-splash +++ b/applications/luci-app-splash/root/usr/sbin/luci-splash @@ -7,6 +7,7 @@ ipc = require "luci.ip" -- Init state session local uci = require "luci.model.uci".cursor_state() +local ipt = require "luci.sys.iptparser".IptParser() local fs = require "nixio.fs" local ip = require "luci.ip" @@ -137,27 +138,33 @@ function ipvalid(ipaddr) end function mac_to_ip(mac) + local ipaddr = nil ipc.neighbors({ family = 4 }, function(n) if n.mac == mac and n.dest then - return n.dest:string() + ipaddr = n.dest:string() end end) + return ipaddr end function mac_to_dev(mac) + local dev = nil ipc.neighbors({ family = 4 }, function(n) if n.mac == mac and n.dev then - return n.dev + dev = n.dev end end) + return dev end function ip_to_mac(ip) + local mac = nil ipc.neighbors({ family = 4 }, function(n) if n.mac and n.dest and n.dest:equal(ip) then - return n.mac + mac = n.mac end end) + return mac end function main(argv) |