Copy channels from only valid operating classes in the source channel
list while preparing a non-6 GHz channel/op-classes list when the 6 GHz
band is not used for P2P GO negotiation.
Earlier, during preparation of P2P channels for GO negotiation, a union
of the GO channels and the P2P Client channels is used. While generating
the union in p2p_channels_union_inplace() as the first list itself has
P2P_MAX_REG_CLASSES number of entries, the operating classes from the
second list which are not in the first list were not getting considered.
Fix this by not setting the dst->reg_classes to too large a value.
Fixes: f7d4f1cbec34 ("P2P: Add a mechanism for allowing 6 GHz channels in channel lists")
Signed-off-by: Sreeramya Soratkal <quic_ssramya@quicinc.com>
return;
}
- for (i = 0, j = 0; i < P2P_MAX_REG_CLASSES; i++) {
+ for (i = 0, j = 0; i < src->reg_classes; i++) {
if (is_6ghz_op_class(src->reg_class[i].reg_class))
continue;
os_memcpy(&dst->reg_class[j], &src->reg_class[i],