Use of wpa_s->p2p_go_no_pri_sec_switch needs to be conditional on
CONFIG_P2P being defined for the build to avoid a compilation error and
ssid->p2p_group to avoid using this for non-P2P AP mode case in
wpa_supplicant. Furthermore, it is better to clear this flag when
stopping a P2P GO to reduce risk of this getting used for a separate
instance of starting a GO.
Fixes: b18d95759375 ("P2P: Disable pri/sec channel switch for GO with forced frequency")
Signed-off-by: Jouni Malinen <j@w1.fi>
}
}
- if (wpa_s->p2p_go_no_pri_sec_switch) {
+#ifdef CONFIG_P2P
+ if (ssid->p2p_group && wpa_s->p2p_go_no_pri_sec_switch) {
conf->no_pri_sec_switch = 1;
- } else if (conf->secondary_channel) {
+ return 0;
+ }
+#endif /* CONFIG_P2P */
+
+ if (conf->secondary_channel) {
struct wpa_supplicant *iface;
for (iface = wpa_s->global->ifaces; iface; iface = iface->next)
os_memset(wpa_s->go_dev_addr, 0, ETH_ALEN);
+ wpa_s->p2p_go_no_pri_sec_switch = 0;
+
return 0;
}