summaryrefslogtreecommitdiffhomepage
path: root/modules
diff options
context:
space:
mode:
authorJo-Philipp Wich <jow@openwrt.org>2010-04-19 18:07:30 +0000
committerJo-Philipp Wich <jow@openwrt.org>2010-04-19 18:07:30 +0000
commit382a33f40a76cedc945ae6895a1341118ca48e4e (patch)
tree966fa7690dba07ff38f3a75770b169e7c39611b1 /modules
parent175cd0342fe950ac0daca5696578aef048d0fda7 (diff)
modules/admin-full: fix crash on network interface overview page
Diffstat (limited to 'modules')
-rw-r--r--modules/admin-full/luasrc/model/cbi/admin_network/network.lua3
1 files changed, 3 insertions, 0 deletions
diff --git a/modules/admin-full/luasrc/model/cbi/admin_network/network.lua b/modules/admin-full/luasrc/model/cbi/admin_network/network.lua
index fffb3e50f..8adfbf137 100644
--- a/modules/admin-full/luasrc/model/cbi/admin_network/network.lua
+++ b/modules/admin-full/luasrc/model/cbi/admin_network/network.lua
@@ -86,8 +86,11 @@ end
hwaddr = s:option(DummyValue, "_hwaddr",
translate("<abbr title=\"Media Access Control\">MAC</abbr>-Address"),
translate("Hardware Address"))
+
function hwaddr.cfgvalue(self, section)
local ix = self.map:get(section, "ifname") or ""
+ ix = (type(ix) == "table") and ix[1] or ix
+
local mac = fs.readfile("/sys/class/net/" .. ix .. "/address")
if not mac then