[Commotion-admin] [luci-commotion] MAC address incorrect in luci advanced menus (1.2rc1) (#467)

Seamus Tuohy notifications at github.com
Wed May 20 12:07:31 EDT 2015


Thanks Andy!

[Here is the code you are looking for:](https://github.com/openwrt/luci/blob/7a3493b1f7d75a3945279115324cf2ff4da26b7b/modules/luci-base/luasrc/model/network.lua#L1068-L1070)

```
function interface.mac(self)
    return (self:_ubus("macaddr") or "00:00:00:00:00:00"):upper()
end
```

[And, here is that Ubus code that is returning None, causing the "00:00:00:00:00:00" to be returned](https://github.com/openwrt/luci/blob/7a3493b1f7d75a3945279115324cf2ff4da26b7b/modules/luci-base/luasrc/model/network.lua#L1053-L1062)

```
function interface._ubus(self, field)
    if not _ubusdevcache[self.ifname] then
        _ubusdevcache[self.ifname] = utl.ubus("network.device", "status",
                                                                     { name = self.ifname })
    end
    if _ubusdevcache[self.ifname] and field then
        return _ubusdevcache[self.ifname][field]
    end
    return _ubusdevcache[self.ifname]
end
```

---
Reply to this email directly or view it on GitHub:
https://github.com/opentechinstitute/luci-commotion/issues/467#issuecomment-103942002
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.chambana.net/pipermail/commotion-admin/attachments/20150520/ef5abeb9/attachment.html>


More information about the Commotion-admin mailing list