applications/luci-wol: cope with host entries that have multiple MACs assigned

This commit is contained in:
Jo-Philipp Wich 2011-07-21 15:26:55 +00:00
parent 390da8e4b1
commit 224dc2daa2

View file

@ -72,7 +72,14 @@ end
uci:foreach("dhcp", "host",
function(s)
if s.mac and s.ip then
arp[s.mac:upper()] = { s.ip, s.name }
if type(s.mac) == "table" then
local m
for _, m in ipairs(s.mac) do
arp[m:upper()] = { s.ip, s.name }
end
else
arp[s.mac:upper()] = { s.ip, s.name }
end
end
end)