modules/admin-full: fix crash on network interface overview page
authorJo-Philipp Wich <jow@openwrt.org>
Mon, 19 Apr 2010 18:07:30 +0000 (18:07 +0000)
committerJo-Philipp Wich <jow@openwrt.org>
Mon, 19 Apr 2010 18:07:30 +0000 (18:07 +0000)
modules/admin-full/luasrc/model/cbi/admin_network/network.lua

index fffb3e5..8adfbf1 100644 (file)
@@ -86,8 +86,11 @@ end
 hwaddr = s:option(DummyValue, "_hwaddr",
        translate("<abbr title=\"Media Access Control\">MAC</abbr>-Address"),
         translate("Hardware Address"))
 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 ""
 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
        local mac = fs.readfile("/sys/class/net/" .. ix .. "/address")
 
        if not mac then