Skip to content

Commit fb98c3e

Browse files
authored
gluon-core: fix channel_width selection (#3806)
mode:match("%d+") returns a string while site.wifi{24,5}.channel_width() returns a number, so "width == channel_width" is never true. Every radio falls through to last_width, which is also compared as a string, making "80" sort above "160". The configured channel width is therefore ignored and radios come up at the widest available mode capped at 80 MHz - including the VHT160 case that e734119 set out to fix. Fixes: e734119 ("gluon-core: fix potentially too low channel_bandwidth")
1 parent a505f76 commit fb98c3e

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

package/gluon-core/luasrc/lib/gluon/upgrade/200-wireless

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ local function get_htmode(radio)
100100
for mode, available in pairs(iwinfo.nl80211.htmodelist(phy)) do
101101
if available then
102102
local hwmode = mode:match("%a+")
103-
local width = mode:match("%d+")
103+
local width = tonumber(mode:match("%d+"))
104104

105105
if hwmode .. width == mode and hwmode == htmode then
106106
if width == channel_width then

0 commit comments

Comments
 (0)