summaryrefslogtreecommitdiffhomepage
path: root/applications/luci-wol/luasrc/model/cbi/wol.lua
diff options
context:
space:
mode:
authorJo-Philipp Wich <jow@openwrt.org>2011-07-21 15:26:55 +0000
committerJo-Philipp Wich <jow@openwrt.org>2011-07-21 15:26:55 +0000
commit224dc2daa2038f35beec665bf687ec0fa9544d29 (patch)
tree1b0ae7f27e7e5518c57a18e266fc410ec428c957 /applications/luci-wol/luasrc/model/cbi/wol.lua
parent390da8e4b1f3f16d996acd0874121e5afdd1aa6f (diff)
applications/luci-wol: cope with host entries that have multiple MACs assigned
Diffstat (limited to 'applications/luci-wol/luasrc/model/cbi/wol.lua')
-rw-r--r--applications/luci-wol/luasrc/model/cbi/wol.lua9
1 files changed, 8 insertions, 1 deletions
diff --git a/applications/luci-wol/luasrc/model/cbi/wol.lua b/applications/luci-wol/luasrc/model/cbi/wol.lua
index 30467f430..ad3479bca 100644
--- a/applications/luci-wol/luasrc/model/cbi/wol.lua
+++ b/applications/luci-wol/luasrc/model/cbi/wol.lua
@@ -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)