lime-packages
lime-packages copied to clipboard
lime.wireless validate that the radios are working
wireless.scandevices() and wireless.mesh_ifaces() are not validating that the radios are working, it is just returning the content of /etc/config/wireless
. This crash when for example one radio is removed (or is broken) from the device, leading to lime-config to crash (and posibly other problems).
A possible fix implementantion is:
function wireless.scandevices()
local devices = {}
local uci = config.get_uci_cursor()
- uci:foreach("wireless", "wifi-device", function(dev) devices[dev[".name"]] = dev end)
+ uci:foreach("wireless", "wifi-device", function(dev)
+ if iwinfo.nl80211.hwmodelist(dev[".name"]) then
+ devices[dev[".name"]] = dev
+ end
+ end)
Is this related to #866?
@spiccinini the code in your commit, do you think can be part of a pull request? If so, do you mind filing it?