From 2b7fa03559c3acd945b9fe369af97a7992afa03d Mon Sep 17 00:00:00 2001 From: Jayachandran Sreekumaran Date: Fri, 8 Mar 2019 16:00:56 +0530 Subject: [PATCH] P2P: Fix ACS offloading behavior with p2p_no_group_iface=1 wpa_s->p2p_go_do_acs was not cleared during P2P group deletion and that resulted in the case of no separate group interface continuing to assume ACS was to be used for consecutive GO starts even if they tried to specify a frequency. Fix this by explicitly clearing wpa_s->p2p_go_do_acs during P2P group deletion and also clear this when processing the P2P_GROUP_ADD if the parameters do not request ACS to be used. Fixes: 37ed3254de22 ("P2P: ACS offload for the autonomous GO") Signed-off-by: Jouni Malinen --- wpa_supplicant/ctrl_iface.c | 2 ++ wpa_supplicant/p2p_supplicant.c | 1 + 2 files changed, 3 insertions(+) diff --git a/wpa_supplicant/ctrl_iface.c b/wpa_supplicant/ctrl_iface.c index 013d05cb3..c627443a8 100644 --- a/wpa_supplicant/ctrl_iface.c +++ b/wpa_supplicant/ctrl_iface.c @@ -6418,6 +6418,8 @@ static int p2p_ctrl_group_add(struct wpa_supplicant *wpa_s, char *cmd) wpa_s->p2p_go_acs_band = HOSTAPD_MODE_IEEE80211ANY; wpa_s->p2p_go_do_acs = 1; } + } else { + wpa_s->p2p_go_do_acs = 0; } #endif /* CONFIG_ACS */ diff --git a/wpa_supplicant/p2p_supplicant.c b/wpa_supplicant/p2p_supplicant.c index 937b70f4e..412903f1d 100644 --- a/wpa_supplicant/p2p_supplicant.c +++ b/wpa_supplicant/p2p_supplicant.c @@ -980,6 +980,7 @@ static int wpas_p2p_group_delete(struct wpa_supplicant *wpa_s, os_free(wpa_s->p2p_group_common_freqs); wpa_s->p2p_group_common_freqs = NULL; wpa_s->p2p_group_common_freqs_num = 0; + wpa_s->p2p_go_do_acs = 0; wpa_s->waiting_presence_resp = 0;