X-Git-Url: https://git.archive.openwrt.org/?p=project%2Fluci.git;a=blobdiff_plain;f=modules%2Fluci-base%2Fluasrc%2Fmodel%2Fnetwork.lua;h=056fc67b144fce476bb05b03913a0f060e88fd31;hp=3521c6d57a3fc935ae9d76c349567ed04e302943;hb=28e3b328545529c19429ce88c7d1769e64e2de0f;hpb=852ec6e28bf90d67882cf909b15a91ecc4501b55 diff --git a/modules/luci-base/luasrc/model/network.lua b/modules/luci-base/luasrc/model/network.lua index 3521c6d57..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 @@ -1001,7 +1001,10 @@ function protocol.ip6addrs(self) if type(addrs) == "table" then for n, addr in ipairs(addrs) do - if type(addr["local-address"]) == "table" then + if type(addr["local-address"]) == "table" and + type(addr["local-address"].mask) == "number" and + type(addr["local-address"].address) == "string" + then rv[#rv+1] = "%s/%d" %{ addr["local-address"].address, addr["local-address"].mask @@ -1230,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)