diff mbox

[2/9] p2p: fix secondary channel selection

Message ID 1434547101-7342-2-git-send-email-ilan.peer@intel.com
State Accepted
Headers show

Commit Message

Ilan Peer June 17, 2015, 1:18 p.m. UTC
From: Eliad Peller <eliad@wizery.com>

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. Fix this by looking for specific
BW40 bw.

Signed-off-by: Eliad Peller <eliadx.peller@intel.com>
---
 wpa_supplicant/p2p_supplicant.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Comments

Jouni Malinen June 19, 2015, 2:10 p.m. UTC | #1
On Wed, Jun 17, 2015 at 04:18:14PM +0300, Ilan Peer wrote:
> 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. Fix this by looking for specific
> BW40 bw.

Thanks, applied.
diff mbox

Patch

diff --git a/wpa_supplicant/p2p_supplicant.c b/wpa_supplicant/p2p_supplicant.c
index 730d793..fa91001 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)