This commit is contained in:
Balázs Urbán 2024-04-18 14:20:29 +08:00 committed by GitHub
commit b2e781f0d1
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 4 additions and 4 deletions

View File

@ -33,10 +33,10 @@ local function get_wifi_interface_labels()
for _, intf in ipairs(dev_table['interfaces']) do for _, intf in ipairs(dev_table['interfaces']) do
local cfg = intf['config'] local cfg = intf['config']
if is_ubus_interface(ubus_interfaces, cfg['ifname']) then if is_ubus_interface(ubus_interfaces, intf['ifname']) then
-- Migrate this to ubus interface once it exposes all interesting labels -- Migrate this to ubus interface once it exposes all interesting labels
local handle = io.popen("hostapd_cli -i " .. cfg['ifname'] .." status") local handle = io.popen("hostapd_cli -i " .. intf['ifname'] .." status")
local hostapd_status = handle:read("*a") local hostapd_status = handle:read("*a")
handle:close() handle:close()
@ -50,7 +50,7 @@ local function get_wifi_interface_labels()
hostapd["channel"] = value hostapd["channel"] = value
-- hostapd gives us all bss on the relevant phy, find the one we're interested in -- hostapd gives us all bss on the relevant phy, find the one we're interested in
elseif string.match(name, "bss%[%d%]") then elseif string.match(name, "bss%[%d%]") then
if value == cfg['ifname'] then if value == intf['ifname'] then
bss_idx = tonumber(string.match(name, "bss%[(%d)%]")) bss_idx = tonumber(string.match(name, "bss%[(%d)%]"))
end end
elseif bss_idx >= 0 then elseif bss_idx >= 0 then
@ -63,7 +63,7 @@ local function get_wifi_interface_labels()
end end
local labels = { local labels = {
vif = cfg['ifname'], vif = intf['ifname'],
ssid = hostapd['ssid'], ssid = hostapd['ssid'],
bssid = hostapd['bssid'], bssid = hostapd['bssid'],
encryption = cfg['encryption'], -- In a mixed scenario it would be good to know if A or B was used encryption = cfg['encryption'], -- In a mixed scenario it would be good to know if A or B was used