From e4a80d89bd80f73a3d07f00334644302c2ad2c53 Mon Sep 17 00:00:00 2001 From: Eliad Peller Date: Wed, 17 Jun 2015 16:18:14 +0300 Subject: [PATCH] P2P: Fix secondary channel selection for HT40 wpas_p2p_get_ht40_mode() used blacklist approach (bw != BW20) to find the relevant op_class, but didn't take into account other non-BW40 cases, like BW80, that had been added to the bw enum after the initial implementation. Fix this by looking for the specific BW40 bw cases. Signed-off-by: Eliad Peller --- wpa_supplicant/p2p_supplicant.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/wpa_supplicant/p2p_supplicant.c b/wpa_supplicant/p2p_supplicant.c index 7bb09b3af..ac4ad5a5d 100644 --- a/wpa_supplicant/p2p_supplicant.c +++ b/wpa_supplicant/p2p_supplicant.c @@ -3321,7 +3321,8 @@ int wpas_p2p_get_ht40_mode(struct wpa_supplicant *wpa_s, for (ch = o->min_chan; ch <= o->max_chan; ch += o->inc) { if (o->mode != HOSTAPD_MODE_IEEE80211A || - o->bw == BW20 || ch != channel) + (o->bw != BW40PLUS && o->bw != BW40MINUS) || + ch != channel) continue; ret = wpas_p2p_verify_channel(wpa_s, mode, ch, o->bw); if (ret == ALLOWED)