X-Git-Url: http://git.archive.openwrt.org/?p=project%2Fluci.git;a=blobdiff_plain;f=modules%2Fluci-base%2Fluasrc%2Fsys.lua;h=b00feda5a8ab264eac40d9766cdf6461a78d60c8;hp=84c747f2bd3bf1e864cbe08046f20d72ac2a3bad;hb=62630fbf880058aa1c7ae10ecf5ae5cb6e4af5bb;hpb=bf04031171b3a64d7a018902123422be70da63bd diff --git a/modules/luci-base/luasrc/sys.lua b/modules/luci-base/luasrc/sys.lua index 84c747f2b..b00feda5a 100644 --- a/modules/luci-base/luasrc/sys.lua +++ b/modules/luci-base/luasrc/sys.lua @@ -146,9 +146,13 @@ local function _nethints(what, callback) if fs.access("/etc/ethers") then for e in io.lines("/etc/ethers") do - mac, ip = e:match("^([a-f0-9]%S+) (%S+)") - if mac and ip then - _add(what, mac:upper(), ip, nil, nil) + mac, name = e:match("^([a-fA-F0-9:]+)%s+(%S+)") + if mac and name then + if luci.ip.IPv4(name) then + _add(what, mac:upper(), name, nil, nil) + else + _add(what, mac:upper(), nil, nil, name) + end end end end