gluon-core: platform: clean up device_supports_mfp()
- Use util.find_phy() - Stop foreach() as soon as the result is known
This commit is contained in:
parent
64725858b4
commit
5ec08d841d
@ -66,21 +66,20 @@ function M.device_supports_wpa3()
|
|||||||
end
|
end
|
||||||
|
|
||||||
function M.device_supports_mfp(uci)
|
function M.device_supports_mfp(uci)
|
||||||
local idx = 0
|
|
||||||
local supports_mfp = true
|
local supports_mfp = true
|
||||||
|
|
||||||
if not M.device_supports_wpa3() then
|
if not M.device_supports_wpa3() then
|
||||||
return false
|
return false
|
||||||
end
|
end
|
||||||
|
|
||||||
uci:foreach('wireless', 'wifi-device', function()
|
uci:foreach('wireless', 'wifi-device', function(radio)
|
||||||
local phypath = '/sys/kernel/debug/ieee80211/phy' .. idx .. '/'
|
local phy = util.find_phy(radio)
|
||||||
|
local phypath = '/sys/kernel/debug/ieee80211/' .. phy .. '/'
|
||||||
|
|
||||||
if not util.file_contains_line(phypath .. 'hwflags', 'MFP_CAPABLE') then
|
if not util.file_contains_line(phypath .. 'hwflags', 'MFP_CAPABLE') then
|
||||||
supports_mfp = false
|
supports_mfp = false
|
||||||
|
return false
|
||||||
end
|
end
|
||||||
|
|
||||||
idx = idx + 1
|
|
||||||
end)
|
end)
|
||||||
|
|
||||||
return supports_mfp
|
return supports_mfp
|
||||||
|
Loading…
Reference in New Issue
Block a user