lime-packages icon indicating copy to clipboard operation
lime-packages copied to clipboard

lime.wireless validate that the radios are working

Open spiccinini opened this issue 3 years ago • 2 comments

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)

spiccinini avatar May 07 '21 22:05 spiccinini

Is this related to #866?

ilario avatar Feb 24 '23 21:02 ilario

@spiccinini the code in your commit, do you think can be part of a pull request? If so, do you mind filing it?

ilario avatar Feb 27 '23 10:02 ilario