From: Jo-Philipp Wich Date: Mon, 19 Apr 2010 18:07:30 +0000 (+0000) Subject: modules/admin-full: fix crash on network interface overview page X-Git-Url: http://git.99rst.org/?a=commitdiff_plain;h=382a33f40a76cedc945ae6895a1341118ca48e4e;p=openwrt-luci.git modules/admin-full: fix crash on network interface overview page --- 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 fffb3e50f2..8adfbf1372 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("MAC-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