summaryrefslogtreecommitdiffhomepage
path: root/modules/luci-base/luasrc/tools
diff options
context:
space:
mode:
Diffstat (limited to 'modules/luci-base/luasrc/tools')
-rw-r--r--modules/luci-base/luasrc/tools/status.lua5
-rw-r--r--modules/luci-base/luasrc/tools/webadmin.lua2
2 files changed, 4 insertions, 3 deletions
diff --git a/modules/luci-base/luasrc/tools/status.lua b/modules/luci-base/luasrc/tools/status.lua
index 4da0cf984b..b531393d0f 100644
--- a/modules/luci-base/luasrc/tools/status.lua
+++ b/modules/luci-base/luasrc/tools/status.lua
@@ -26,17 +26,18 @@ local function dhcp_leases_common(family)
break
else
local ts, mac, ip, name, duid = ln:match("^(%d+) (%S+) (%S+) (%S+) (%S+)")
+ local expire = tonumber(ts) or 0
if ts and mac and ip and name and duid then
if family == 4 and not ip:match(":") then
rv[#rv+1] = {
- expires = os.difftime(tonumber(ts) or 0, os.time()),
+ expires = (expire ~= 0) and os.difftime(expire, os.time()),
macaddr = mac,
ipaddr = ip,
hostname = (name ~= "*") and name
}
elseif family == 6 and ip:match(":") then
rv[#rv+1] = {
- expires = os.difftime(tonumber(ts) or 0, os.time()),
+ expires = (expire ~= 0) and os.difftime(expire, os.time()),
ip6addr = ip,
duid = (duid ~= "*") and duid,
hostname = (name ~= "*") and name
diff --git a/modules/luci-base/luasrc/tools/webadmin.lua b/modules/luci-base/luasrc/tools/webadmin.lua
index 8273175de7..106810aa03 100644
--- a/modules/luci-base/luasrc/tools/webadmin.lua
+++ b/modules/luci-base/luasrc/tools/webadmin.lua
@@ -96,7 +96,7 @@ function iface_get_network(iface)
if net.l3_device == iface or net.device == iface then
-- cross check with uci to filter out @name style aliases
local uciname = cur:get("network", net.interface, "ifname")
- if not uciname or uciname:sub(1, 1) ~= "@" then
+ if type(uciname) == "string" and uciname:sub(1,1) ~= "@" or uciname then
return net.interface
end
end