mirror of
https://github.com/vanhoefm/fragattacks.git
synced 2025-01-30 08:44:03 -05:00
P2P: Select HT40 channel at random instead of using the first entry
Use the new p2p_channel_select() function to select an HT40 channel at random when no other preferences are in effect. Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>
This commit is contained in:
parent
5576663fba
commit
ee8f6ea0ca
@ -349,6 +349,7 @@ void p2p_reselect_channel(struct p2p_data *p2p,
|
|||||||
u8 op_reg_class, op_channel;
|
u8 op_reg_class, op_channel;
|
||||||
unsigned int i;
|
unsigned int i;
|
||||||
const int op_classes_5ghz[] = { 115, 124, 0 };
|
const int op_classes_5ghz[] = { 115, 124, 0 };
|
||||||
|
const int op_classes_ht40[] = { 116, 117, 126, 127, 0 };
|
||||||
|
|
||||||
if (p2p->own_freq_preference > 0 &&
|
if (p2p->own_freq_preference > 0 &&
|
||||||
p2p_freq_to_channel(p2p->own_freq_preference,
|
p2p_freq_to_channel(p2p->own_freq_preference,
|
||||||
@ -426,16 +427,11 @@ void p2p_reselect_channel(struct p2p_data *p2p,
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Try a channel where we might be able to use HT40 */
|
/* Try a channel where we might be able to use HT40 */
|
||||||
for (i = 0; i < intersection->reg_classes; i++) {
|
if (p2p_channel_select(intersection, op_classes_ht40,
|
||||||
struct p2p_reg_class *c = &intersection->reg_class[i];
|
&p2p->op_reg_class, &p2p->op_channel) == 0) {
|
||||||
if (c->reg_class == 116 || c->reg_class == 117 ||
|
p2p_dbg(p2p, "Pick possible HT40 channel (op_class %u channel %u) from intersection",
|
||||||
c->reg_class == 126 || c->reg_class == 127) {
|
p2p->op_reg_class, p2p->op_channel);
|
||||||
p2p_dbg(p2p, "Pick possible HT40 channel (reg_class %u channel %u) from intersection",
|
return;
|
||||||
c->reg_class, c->channel[0]);
|
|
||||||
p2p->op_reg_class = c->reg_class;
|
|
||||||
p2p->op_channel = c->channel[0];
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Prefer a 5 GHz channel */
|
/* Prefer a 5 GHz channel */
|
||||||
|
Loading…
Reference in New Issue
Block a user