X-Git-Url: http://git.archive.openwrt.org/?p=project%2Fluci.git;a=blobdiff_plain;f=modules%2Fluci-base%2Fluasrc%2Ftools%2Fstatus.lua;h=95ff46df15eeda415a808a1f6e5087caf23bd0ae;hp=b531393d0fa8b5dd91ba8caa1aa618094497a0f1;hb=fecf6e1d11d466efa7b1bbf05633931a3081517e;hpb=5180a5bb8bcab18e06d25dbe94ba3f5e37e66248 diff --git a/modules/luci-base/luasrc/tools/status.lua b/modules/luci-base/luasrc/tools/status.lua index b531393d0..95ff46df1 100644 --- a/modules/luci-base/luasrc/tools/status.lua +++ b/modules/luci-base/luasrc/tools/status.lua @@ -74,9 +74,19 @@ local function dhcp_leases_common(family) hostname = (name ~= "-") and name } elseif ip and iaid == "ipv4" and family == 4 then + local mac, mac1, mac2, mac3, mac4, mac5, mac6 + if duid and type(duid) == "string" then + mac1, mac2, mac3, mac4, mac5, mac6 = duid:match("^(%x%x)(%x%x)(%x%x)(%x%x)(%x%x)(%x%x)$") + end + if not (mac1 and mac2 and mac3 and mac4 and mac5 and mac6) then + mac = "FF:FF:FF:FF:FF:FF" + else + mac = mac1..":"..mac2..":"..mac3..":"..mac4..":"..mac5..":"..mac6 + end rv[#rv+1] = { expires = (expire >= 0) and os.difftime(expire, os.time()), macaddr = duid, + macaddr = mac:lower(), ipaddr = ip, hostname = (name ~= "-") and name }