summaryrefslogtreecommitdiffhomepage
path: root/modules/luci-base/luasrc/model/network.lua
diff options
context:
space:
mode:
authorJo-Philipp Wich <jo@mein.io>2018-03-12 16:12:18 +0100
committerJo-Philipp Wich <jo@mein.io>2018-03-12 16:12:18 +0100
commit28e3b328545529c19429ce88c7d1769e64e2de0f (patch)
tree3d7d85d7d4d1202199bad98df125f2af88b73c86 /modules/luci-base/luasrc/model/network.lua
parentdfba318140e1a84359e221b7a9154337595dbded (diff)
treewide: unify mac address handling
Use the new luci.ip MAC address facilities to parse and verify MAC addresses in a common way, instead of relying on various ad-hoc solutions. Signed-off-by: Jo-Philipp Wich <jo@mein.io>
Diffstat (limited to 'modules/luci-base/luasrc/model/network.lua')
-rw-r--r--modules/luci-base/luasrc/model/network.lua5
1 files changed, 2 insertions, 3 deletions
diff --git a/modules/luci-base/luasrc/model/network.lua b/modules/luci-base/luasrc/model/network.lua
index c8ec5364e..056fc67b1 100644
--- a/modules/luci-base/luasrc/model/network.lua
+++ b/modules/luci-base/luasrc/model/network.lua
@@ -330,7 +330,7 @@ function init(cursor)
if i.family == "packet" then
_interfaces[name].flags = i.flags
_interfaces[name].stats = i.data
- _interfaces[name].macaddr = i.addr
+ _interfaces[name].macaddr = ipc.checkmac(i.addr)
elseif i.family == "inet" then
_interfaces[name].ipaddrs[#_interfaces[name].ipaddrs+1] = ipc.IPv4(i.addr, i.netmask)
elseif i.family == "inet6" then
@@ -1233,8 +1233,7 @@ function interface.name(self)
end
function interface.mac(self)
- local mac = self:_ubus("macaddr")
- return mac and mac:upper()
+ return ipc.checkmac(self:_ubus("macaddr"))
end
function interface.ipaddrs(self)