From 40e9a3f326f684634911fbd333a8d5f9efce3b86 Mon Sep 17 00:00:00 2001 From: Jouni Malinen Date: Sat, 7 Jan 2017 12:49:48 +0200 Subject: [PATCH] RRM: Fix beacon report scan channels for VHT 80, 80+80, 160 MHz cases ieee80211_chan_to_freq() is not really meant for conversion of 20 MHz primary channel numbers for wider VHT channels, so handle those as special cases here for now. Signed-off-by: Jouni Malinen --- wpa_supplicant/rrm.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/wpa_supplicant/rrm.c b/wpa_supplicant/rrm.c index f16cbc21d..af2759e16 100644 --- a/wpa_supplicant/rrm.c +++ b/wpa_supplicant/rrm.c @@ -424,6 +424,12 @@ static int wpas_add_channel(u8 op_class, u8 chan, u8 num_primary_channels, u8 primary_chan = chan - (2 * num_primary_channels - 2) + i * 4; freqs[i] = ieee80211_chan_to_freq(NULL, op_class, primary_chan); + /* ieee80211_chan_to_freq() is not really meant for this + * conversion of 20 MHz primary channel numbers for wider VHT + * channels, so handle those as special cases here for now. */ + if (freqs[i] < 0 && + (op_class == 128 || op_class == 129 || op_class == 130)) + freqs[i] = 5000 + 5 * primary_chan; if (freqs[i] < 0) { wpa_printf(MSG_DEBUG, "Beacon Report: Invalid channel %u",