From 760d10cdea4d0c0e1a694e83b94b5dd0f71b7dc3 Mon Sep 17 00:00:00 2001 From: Sreeramya Soratkal Date: Tue, 18 Aug 2020 21:46:12 +0530 Subject: [PATCH] P2P: Include channels 149 to 161 for operating classes 128 and 130 With the configuration defined in the global_op_class array, the channels starting from 149 in the operating classes 128 and 130 were not considered for P2P channel setup due to the non-continuous incrementation of channel indexes. The other channels in these operating classes were considered. Handle the channels from 149 to 161 in the operating classes 128 and 130 for P2P channel setup by handling this jump in the channel number incrementation. Signed-off-by: Sreeramya Soratkal --- wpa_supplicant/p2p_supplicant.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/wpa_supplicant/p2p_supplicant.c b/wpa_supplicant/p2p_supplicant.c index 93dd93d34..e26e8051d 100644 --- a/wpa_supplicant/p2p_supplicant.c +++ b/wpa_supplicant/p2p_supplicant.c @@ -3737,6 +3737,13 @@ static int wpas_p2p_setup_channels(struct wpa_supplicant *wpa_s, wpa_s->global->p2p_24ghz_social_channels = 1; for (ch = o->min_chan; ch <= o->max_chan; ch += o->inc) { enum chan_allowed res; + + /* Check for non-continuous jump in channel index + * incrementation */ + if ((o->op_class == 128 || o->op_class == 130) && + ch < 149 && ch + o->inc > 149) + ch = 149; + res = wpas_p2p_verify_channel(wpa_s, mode, ch, o->bw); if (res == ALLOWED) { if (reg == NULL) {