From 382a33f40a76cedc945ae6895a1341118ca48e4e Mon Sep 17 00:00:00 2001 From: Jo-Philipp Wich Date: Mon, 19 Apr 2010 18:07:30 +0000 Subject: [PATCH] modules/admin-full: fix crash on network interface overview page --- modules/admin-full/luasrc/model/cbi/admin_network/network.lua | 3 +++ 1 file changed, 3 insertions(+) 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("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 -- 2.11.0